diff --git a/README.md b/README.md index 9709f5c..043cf61 100644 --- a/README.md +++ b/README.md @@ -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);};` | diff --git a/snippets/snippets.json b/snippets/snippets.json index d0db16a..6b4cd23 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -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",