Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chriscorwin/8eb3307de78fb34f6112 to your computer and use it in GitHub Desktop.
Save chriscorwin/8eb3307de78fb34f6112 to your computer and use it in GitHub Desktop.
Snippet for NodeJS's util library that inspects all levels of a variable
<snippet>
<!-- Snippet for https://nodejs.org/api/util.html -->
<!-- Put this file in `Sublime Text 3/packages/User/ then restart. -->
<!-- Don't forget to import `const util = require('util');` -->
<content><![CDATA[
console.log(`[ $TM_FILEPATH:$TM_LINE_NUMBER ] ${1:$SELECTION}: `, util.inspect(${2:$SELECTION}, { showHidden: true, depth: null, colors: true }));$0
]]></content>
<tabTrigger>util</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log(util.inspect())</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment