Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
VS Code JavaScript User Snippet
{
"Test flag": {
"prefix": "test",
"body": [
"// @test"
],
"description": "Flag line as testing only"
},
"Todo flag": {
"prefix": "todo",
"body": [
"// @todo"
],
"description": "Flag line as todo"
},
"Debugger statement": {
"prefix": "db",
"body": [
"debugger; // @test"
],
"description": "Insert a flagged debugger statement"
},
"Console message": {
"prefix": "msg",
"body": [
"console.log(\"${1:thing}\"); // @test"
],
"description": "Log a simple static message"
},
"Console info": {
"prefix": "info",
"body": [
"console.info(\"${1:thing}\", ${1:thing}); // @test"
],
"description": "Log some data with a label"
},
"Write to file": {
"prefix": "write",
"body": [
"(function(n,c){require('fs').writeFile('/some/path/'+n+'.html',c);})('${1:c}',${1}); // @test"
],
"description": "Write some content to file."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.