JavaScript Snippets

Viewable at https://gist.github.com/drhayes/280d1b563034e1f5c186cafe02c5fab2.

{
  "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."
  }
}