{"repo":"debug-js/debug","free":true,"listed":false,"github":"https://github.com/debug-js/debug","clone":"git clone https://github.com/debug-js/debug.git","description":"A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers","language":"JavaScript","stars":11450,"topics":["javascript","logging","browser","debug","debugging","node","node-js"],"license":"MIT","category":"dev-tools","readme_excerpt":"debug A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers. Installation Usage debug exposes a function; simply pass this function the name of your module, and it will return a decorated version of console.error for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. Example app.js : Example worker.js : The DEBUG environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: Windows command prompt notes CMD On Windows the environment variable is set using the set command. Example: PowerShell (VS Code default) PowerShell uses different syntax to set environment variables. Example: Then, run the program to be debugged as usual. npm script example: Namespace Colors Every debug instance has a color generated for it based on its namespace name. This helps when visually parsing the debug output to identify which debug instance a debug line belongs to. Node.js In Node.js, colors are enabled when stderr is a TTY. You also should install the supports-color module alongside debug, otherwise debug will only use a small handful of basic colors. Web Browser Colors are also enabled on \"Web Inspectors\" that understand the %c formatting option. These are WebKit web inspectors, Firefox (since version 31) and the Firebug plugin for Firefox (any version). Millisecond diff When acti","default_branch":null,"files":null,"tree":[],"storefront":"/r/debug-js","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/debug-js/debug/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}