diff --git a/examples/browser/colors.html b/examples/browser/colors.html deleted file mode 100644 index ce969072..00000000 --- a/examples/browser/colors.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - debug() - - - - - - - Open your - Web Inspector - to see the debug output - - diff --git a/examples/node/app.js b/examples/node/app.js deleted file mode 100644 index 08d3f257..00000000 --- a/examples/node/app.js +++ /dev/null @@ -1,20 +0,0 @@ -const http = require('http'); - -const debug = require('../..')('http'); - -const name = 'My App'; - -// Fake app - -debug('booting %o', name); - -http.createServer((req, res) => { - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, () => { - debug('listening'); -}); - -// Fake worker of some kind -// eslint-disable-next-line import/no-unassigned-import -require('./worker'); diff --git a/examples/node/colors.js b/examples/node/colors.js deleted file mode 100644 index 9cbfa1f9..00000000 --- a/examples/node/colors.js +++ /dev/null @@ -1,8 +0,0 @@ -const debug = require('../..'); - -debug.enable('*'); - -for (let i = 0; i < debug.colors.length; i++) { - const d = debug('example:' + i); - d('The color is %o', d.color); -} diff --git a/examples/node/stdout.js b/examples/node/stdout.js deleted file mode 100644 index 17558da0..00000000 --- a/examples/node/stdout.js +++ /dev/null @@ -1,18 +0,0 @@ -const debug = require('../..'); - -const error = debug('app:error'); - -// By default stderr is used -error('goes to stderr!'); - -const log = debug('app:log'); -// Set this namespace to log via console.log -log.log = console.log.bind(console); // Don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// Set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); diff --git a/examples/node/wildcards.js b/examples/node/wildcards.js deleted file mode 100644 index 2cedc2d8..00000000 --- a/examples/node/wildcards.js +++ /dev/null @@ -1,10 +0,0 @@ - -const debug = { - foo: require('../..')('test:foo'), - bar: require('../..')('test:bar'), - baz: require('../..')('test:baz') -}; - -debug.foo('foo'); -debug.bar('bar'); -debug.baz('baz'); diff --git a/examples/node/worker.js b/examples/node/worker.js deleted file mode 100644 index 6f483a66..00000000 --- a/examples/node/worker.js +++ /dev/null @@ -1,27 +0,0 @@ - -// DEBUG=* node example/worker -// DEBUG=worker:* node example/worker -// DEBUG=worker:a node example/worker -// DEBUG=worker:b node example/worker - -const a = require('../..')('worker:a'); - -const b = require('../..')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); - -setTimeout(() => { - b(new Error('fail')); -}, 5000);