NPM Package Snippet
NPM Package Snippet for Visual Studio Code
Install
Features
- Configurable Prefix
- Configurable Style
Configurable style for semicolon (; ), single quote (' ) or double quote (" )
- Recursively
Walking up package.json file, starting from opened current file in the editor.
- Configurable Language
Running snippet on another language (e.g: markdown ).
Usage
Module |
Prefix / Hint |
Common JS |
pkg-req:<moduleId> |
ES Module |
pkg-imp:<moduleId> |
Typescript |
pkg-ts:<moduleId> |
Default Configuration
After changed snippet configuration, restart the editor.
{
"snippet.npm-package.filename": "",
"snippet.npm-package.semicolon": true,
"snippet.npm-package.prefix.cjs": "pkg-req:",
"snippet.npm-package.prefix.esm": "pkg-imp:",
"snippet.npm-package.prefix.ts": "pkg-ts:",
"snippet.npm-package.quotes": "single",
"snippet.npm-package.languages": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
}
Schema
filename: <string>
{
"snippet.npm-package.filename": "<your-snippet-filename>.code-snippets",
}
quotes: <string>
- enum:
single | double
- example:
{
"snippet.npm-package.quotes": "single",
"snippet.npm-package.quotes": "double",
}
License
MIT © Guntur Poetra
| |