Skip to content

Instantly share code, notes, and snippets.

@drhayes
Created June 14, 2021 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drhayes/280d1b563034e1f5c186cafe02c5fab2 to your computer and use it in GitHub Desktop.
Save drhayes/280d1b563034e1f5c186cafe02c5fab2 to your computer and use it in GitHub Desktop.
My current custom JavaScript snippets for Visual Studio Code.
{
"Print to console": {
"prefix": "clog",
"body": [
"console.log($1);$0"
],
"description": "Console log"
},
"CommonJS require": {
"prefix": "creq",
"body": [
"const ${1:fs} = require('${2:$1}');$0"
],
"description": "Insert a commonjs require statement"
},
"async function": {
"prefix": "afunc",
"body": [
"async function ${1:func}($2) {",
"$0",
"}"
],
"description": "Insert an async function declaration."
},
"import statement":{
"prefix": "import",
"body": "import ${2:{ $0 \\}} from '$1';",
"description": "Make an import statement."
},
"export default": {
"prefix": "ed",
"body": "export default $0",
"description": "Writes out 'export default'"
},
"arrow function": {
"prefix": "arf",
"body": "() => ${1:{ $0 \\}}",
"description": "Writes an arrow function."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment