Skip to content

Instantly share code, notes, and snippets.

@aspen-roller
Created December 3, 2020 19:07
Show Gist options
  • Save aspen-roller/63ed267c2dccf8fd627701743199939b to your computer and use it in GitHub Desktop.
Save aspen-roller/63ed267c2dccf8fd627701743199939b to your computer and use it in GitHub Desktop.
vscode snippets #vscode
{
/*
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
*/
"New Module": {
"prefix": "newmod",
"body": [
"'use strict';",
"",
"module.exports = ${1:moduleName};",
"",
"function $1($2) {",
" $0",
"}"
],
"description": "Create a new Node.js module"
},
"New Test": {
"prefix": "newtest",
"body": [
"'use strict';",
"",
"const { expect } = require('chai');",
"",
"describe('${1:scenario}', function() {",
"",
" it('${2:test}', function() {",
" $0",
" });",
"});"
"",
],
"description": "Create a new Mocha test"
},
"Print to console": {
"prefix": "conlog",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},
"Print deep": {
"prefix": "condir",
"body": [
"console.dir($1, { depth: ${2:null} });",
"$0"
],
"description": "Log guts of an object to console"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment