Skip to content

Instantly share code, notes, and snippets.

@josephm28
Created December 6, 2019 13:57
Show Gist options
  • Save josephm28/77ebaa8e16afe0f08c99765256cff588 to your computer and use it in GitHub Desktop.
Save josephm28/77ebaa8e16afe0f08c99765256cff588 to your computer and use it in GitHub Desktop.
Add todo method to console
console.todo = function(todo: string) {
var err = new Error();
console.log(`%c\tTODO\t${todo}\t\n`, 'background: #66ba6559; color: #046884');
console.groupCollapsed();
console.log(
err.stack
.split('\n')
.slice(0, 3)
.join('\n'),
);
console.log(`^^^ That's the TODO location ^^^`);
console.groupEnd();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment