Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

code-snips

Quickly generate code snippets from source code files.

import { snip } from "code-snips/snip";
import { readFileSync } from "fs";

// Snip start myFunc
const myFunc = () => {
    console.log("Hello World!");
}
// Snip end myFunc

const fileContent = readFileSync('./demo.ts', 'utf-8');
const snippet = snip(fileContent, "myFunc", "ts");
console.log(snippet);
Output:
const myFunc = () => {
    console.log("Hello World!");
}

Currently supports TypeScript and JavaScript.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages