{"name":"debug","description":"Lightweight debugging utility for Node.js and the browser","dist-tags":{"latest":"4.3.5"},"versions":{"4.3.5":{"name":"debug","version":"4.3.5","author":{"url":"https://github.com/qix-","name":"Josh Junon"},"license":"MIT","_id":"debug@4.3.5","bugs":{"url":"https://github.com/debug-js/debug/issues"},"dist":{"shasum":"e83444eceb9fedd4a1da56d671ae2446a01a6e1e","tarball":"http://localhost:4260/debug/debug-4.3.5.tgz","fileCount":7,"integrity":"sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==","signatures":[{"sig":"MEUCIQD2eFpf3p60i2+rFrwBiP8ctewWXYfqZxZvMEU/XyX/xAIgJXRFOrWWj+tLfHrd400HHT/bz+yV4Edh8cAmQFDP3Jw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42430},"main":"./src/index.js","browser":"./src/browser.js","engines":{"node":">=6.0"},"gitHead":"5464bdddbc6f91b2aef2ad20650d3a6cfd9fcc3a","scripts":{"lint":"xo","test":"npm run test:node && npm run test:browser && npm run lint","test:node":"istanbul cover _mocha -- test.js test.node.js","test:browser":"karma start --single-run","test:coverage":"cat ./coverage/lcov.info | coveralls"},"repository":{"url":"git://github.com/debug-js/debug.git","type":"git"},"_npmVersion":"10.2.4","description":"Lightweight debugging utility for Node.js and the browser","directories":{},"_nodeVersion":"21.3.0","dependencies":{"ms":"2.1.2"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.23.0","brfs":"^2.0.1","karma":"^3.1.4","mocha":"^5.2.0","sinon":"^14.0.0","istanbul":"^0.4.5","coveralls":"^3.0.2","browserify":"^16.2.3","karma-mocha":"^1.3.0","karma-browserify":"^6.0.0","mocha-lcov-reporter":"^1.2.0","karma-chrome-launcher":"^2.2.0"},"peerDependenciesMeta":{"supports-color":{"optional":true}}}},"author":{"url":"https://github.com/qix-","name":"Josh Junon"},"repository":{"url":"git://github.com/debug-js/debug.git","type":"git"},"license":"MIT","homepage":"https://github.com/debug-js/debug#readme","bugs":{"url":"https://github.com/debug-js/debug/issues"},"readme":"# debug\n[![Build Status](https://travis-ci.org/debug-js/debug.svg?branch=master)](https://travis-ci.org/debug-js/debug) [![Coverage Status](https://coveralls.io/repos/github/debug-js/debug/badge.svg?branch=master)](https://coveralls.io/github/debug-js/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers)\n[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)\n\n<img width=\"647\" src=\"https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png\">\n\nAtinyJavaScriptdebuggingutilitymodelledafterNode.jscore'sdebugging\ntechnique.WorksinNode.jsandwebbrowsers.\n\n##Installation\n\n```bash\n$npminstalldebug\n```\n\n##Usage\n\n`debug`exposesafunction;simplypassthisfunctionthenameofyourmodule,anditwillreturnadecoratedversionof`console.error`foryoutopassdebugstatementsto.Thiswillallowyoutotogglethedebugoutputfordifferentpartsofyourmoduleaswellasthemoduleasawhole.\n\nExample[_app.js_](./examples/node/app.js):\n\n```js\nvardebug=require('debug')('http')\n,http=require('http')\n,name='MyApp';\n\n// fake app\n\ndebug('booting %o', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample [_worker.js_](./examples/node/worker.js):\n\n```js\nvar a = require('debug')('worker:a')\n , b = require('debug')('worker:b');\n\nfunction work() {\n a('doing lots of uninteresting work');\n setTimeout(work, Math.random() * 1000);\n}\n\nwork();\n\nfunction workb() {\n b('doing some work');\n setTimeout(workb, Math.random() * 2000);\n}\n\nworkb();\n```\n\nThe `DEBUG` environment variable is then used to enable these based on space or\ncomma-delimited names