Skip to content

Instantly share code, notes, and snippets.

@favio41
Last active August 4, 2020 10:35
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 favio41/25d167f2ab4824674a5bceaf1ba1c4d2 to your computer and use it in GitHub Desktop.
Save favio41/25d167f2ab4824674a5bceaf1ba1c4d2 to your computer and use it in GitHub Desktop.
{
"Print object to console":{
"prefix": "stringify",
"body": "console.log(\"stringify $0\", JSON.stringify($0, null, 2))"
},
"Safe print object to console":{
"prefix": "stringifysafe",
"body": "console.log('inspect $0',require('util').inspect($0))"
},
"saveToFile":{
"prefix": "stringifyToFile",
"body": "require('fs').writeFileSync('/tmp/$1.json', JSON.stringify($0, null, 2))"
},
"Print keys to console":{
"prefix": "keys",
"body": "console.log(Object.keys($0))"
},
"Parse JSON":{
"prefix": "parse",
"body": "JSON.parse($0)"
},
"usestrict":{
"prefix": "usestrict",
"body": [
"'use strict'",
"",
]
},
"eslint-disable": {
"prefix": "eslint-disable",
"body": "// eslint-disable-line"
},
"max-len": {
"prefix": "max-len",
"body": " // eslint-disable-line max-len"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment