Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added new snippet to require package to const #70

Merged
merged 1 commit into from
Apr 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Below is a list of all available snippets and the triggers of each one. The **
| `ime→` | imports everything as alias from the module `import * as localAlias from 'fs';` |
| `ima→` | imports only a portion of the module as alias `import { rename as localRename } from 'fs';` |
| `rqr→` | require package `require('');`|
| `req→` | require package to const `const packageName = require('packageName');`|
| `mde→` | default module.exports `module.exports = {};`|
| `enf→` | exports name function `export const log = (parameter) => { console.log(parameter);};` |
| `edf→` | exports default function `export default (parameter) => { console.log(parameter);};` |
Expand Down
5 changes: 5 additions & 0 deletions snippets/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"body": "require('${1:package}');",
"description": "Require a package"
},
"requireToConst": {
"prefix": "req",
"body": "const ${1:packageName} = require('${1:package}');$0",
"description": "Require a package to const"
},
"moduleExports": {
"prefix": "mde",
"body": "module.exports = {\n\t$0\n};\n",
Expand Down