Skip to content

Instantly share code, notes, and snippets.

@orimdominic
Last active September 14, 2023 08:11
Show Gist options
  • Save orimdominic/67ca90e6c8b4f1a18636810ae1486659 to your computer and use it in GitHub Desktop.
Save orimdominic/67ca90e6c8b4f1a18636810ae1486659 to your computer and use it in GitHub Desktop.
VSCode snippets
{
// 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:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"JSDoc snippet": {
"prefix": "jsdoc",
"body": [
"/** $1 */"
],
"description": "Create a JSDoc snippet"
},
"Code at": {
"prefix": "codeat",
"body": [
"console.log(`@$1`);"
],
"description": "Log at code location"
},
"jest describe": {
"prefix": "jestdesc",
"body": [
"describe(\"$1\", function() {\n$2\n})"
]
},
"jest it": {
"prefix": "jestit",
"body": [
"it(\"$1\", function() {\n$2\n})"
]
},
"jest it async": {
"prefix": "jestitasync",
"body": [
"it(\"$1\", async function() {\n$2\n})"
]
},
"noop": {
"prefix": "noop",
"body": [
"function(){ /* no operation */ }"
]
},
"minimalexpresshandler": {
"prefix": "minimalexpresshandler",
"body": [
"(rq, rs) => rs.send(\"ok\"),"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment