{"_id":"intercept-stdout","_rev":"2771100","name":"intercept-stdout","description":"Hooking Node.js stdout","dist-tags":{"latest":"0.1.2"},"maintainers":[{"name":"stevefar","email":""}],"time":{"modified":"2022-05-23T09:39:21.000Z","created":"2014-01-28T17:42:06.900Z","0.1.2":"2015-07-29T12:35:56.903Z","0.1.1":"2015-05-19T13:15:28.251Z","0.0.3":"2015-02-17T18:19:12.127Z","0.0.2":"2014-01-28T18:45:41.133Z","0.0.1":"2014-01-28T17:42:06.900Z"},"users":{},"author":{"name":"Steven Farthing"},"repository":{"type":"git","url":"https://github.com/sfarthin/intercept-stdout"},"versions":{"0.1.2":{"name":"intercept-stdout","version":"0.1.2","description":"Hooking Node.js stdout","main":"intercept-stdout.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/sfarthin/intercept-stdout"},"keywords":["stdout","stderr"],"author":{"name":"Steven Farthing"},"license":"MIT","bugs":{"url":"https://github.com/sfarthin/intercept-stdout/issues"},"dependencies":{"lodash.toarray":"^3.0.0"},"devDependencies":{"chai":"~1.8.1","mocha":"~1.17.1"},"gitHead":"6a1338d630f422424c16fe1fb23f9934b80ee769","homepage":"https://github.com/sfarthin/intercept-stdout","_id":"intercept-stdout@0.1.2","_shasum":"126abf1fae6c509a428a98c61a631559042ae9fd","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"stevefar","email":"me@stevefar.com"},"maintainers":[{"name":"stevefar","email":""}],"dist":{"shasum":"126abf1fae6c509a428a98c61a631559042ae9fd","size":3395,"noattachment":false,"key":"/intercept-stdout/-/intercept-stdout-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/intercept-stdout/download/intercept-stdout-0.1.2.tgz"},"publish_time":1438173356903,"_hasShrinkwrap":false,"_cnpm_publish_time":1438173356903,"_cnpmcore_publish_time":"2021-12-16T17:44:28.940Z"},"0.1.1":{"name":"intercept-stdout","version":"0.1.1","description":"Hooking Node.js stdout","main":"intercept-stdout.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/sfarthin/intercept-stdout"},"keywords":["stdout","stderr"],"author":{"name":"Steven Farthing"},"license":"MIT","bugs":{"url":"https://github.com/sfarthin/intercept-stdout/issues"},"dependencies":{"lodash.toarray":"^3.0.0"},"devDependencies":{"chai":"~1.8.1","mocha":"~1.17.1"},"gitHead":"cbf78b183865162aa549d8f74507740516f11521","homepage":"https://github.com/sfarthin/intercept-stdout","_id":"intercept-stdout@0.1.1","_shasum":"873d1feacfd5ad443781ae84333fef8ca70bccd5","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"stevefar","email":"me@stevefar.com"},"maintainers":[{"name":"stevefar","email":""}],"dist":{"shasum":"873d1feacfd5ad443781ae84333fef8ca70bccd5","size":2616,"noattachment":false,"key":"/intercept-stdout/-/intercept-stdout-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/intercept-stdout/download/intercept-stdout-0.1.1.tgz"},"publish_time":1432041328251,"_hasShrinkwrap":false,"_cnpm_publish_time":1432041328251,"_cnpmcore_publish_time":"2021-12-16T17:44:29.160Z"},"0.0.3":{"name":"intercept-stdout","version":"0.0.3","description":"Hooking Node.js stdout","main":"intercept-stdout.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/sfarthin/intercept-stdout"},"keywords":["stdout","stderr"],"author":{"name":"Steven Farthing"},"license":"MIT","bugs":{"url":"https://github.com/sfarthin/intercept-stdout/issues"},"dependencies":{"lodash.toarray":"^3.0.0"},"devDependencies":{"chai":"~1.8.1","mocha":"~1.17.1"},"gitHead":"df5a3df513c00394e31779087a0b5cdbca999c49","homepage":"https://github.com/sfarthin/intercept-stdout","_id":"intercept-stdout@0.0.3","_shasum":"5b4930dacf72ce0cc78c34096d5ca9a318e6b546","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"stevefar","email":"me@stevefar.com"},"maintainers":[{"name":"stevefar","email":""}],"dist":{"shasum":"5b4930dacf72ce0cc78c34096d5ca9a318e6b546","size":2299,"noattachment":false,"key":"/intercept-stdout/-/intercept-stdout-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/intercept-stdout/download/intercept-stdout-0.0.3.tgz"},"publish_time":1424197152127,"_hasShrinkwrap":false,"_cnpm_publish_time":1424197152127,"_cnpmcore_publish_time":"2021-12-16T17:44:29.397Z"},"0.0.2":{"name":"intercept-stdout","version":"0.0.2","description":"Hooking Node.js stdout","main":"intercept-stdout.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/sfarthin/intercept-stdout"},"keywords":["stdout","stderr"],"author":{"name":"Steven Farthing"},"license":"MIT","bugs":{"url":"https://github.com/sfarthin/intercept-stdout/issues"},"dependencies":{"underscore":"~1.5.2","chai":"~1.8.1","mocha":"~1.17.1"},"_id":"intercept-stdout@0.0.2","dist":{"shasum":"c138ed83dd62a4cb349273136c489f14989e6a67","size":2220,"noattachment":false,"key":"/intercept-stdout/-/intercept-stdout-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/intercept-stdout/download/intercept-stdout-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"stevefar","email":"me@stevefar.com"},"maintainers":[{"name":"stevefar","email":""}],"publish_time":1390934741133,"_hasShrinkwrap":false,"_cnpm_publish_time":1390934741133,"_cnpmcore_publish_time":"2021-12-16T17:44:29.644Z"},"0.0.1":{"name":"intercept-stdout","version":"0.0.1","description":"Hooking Node.js stdout","main":"intercept-stdout.js","directories":{"test":"test"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/sfarthin/intercept-stdout"},"keywords":["stdout","stderr"],"author":{"name":"Steven Farthing"},"license":"MIT","bugs":{"url":"https://github.com/sfarthin/intercept-stdout/issues"},"dependencies":{"underscore":"~1.5.2","chai":"~1.8.1","mocha":"~1.17.1"},"_id":"intercept-stdout@0.0.1","dist":{"shasum":"df458f3865d5b010928497384e256598f0910753","size":2096,"noattachment":false,"key":"/intercept-stdout/-/intercept-stdout-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/intercept-stdout/download/intercept-stdout-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"stevefar","email":"me@stevefar.com"},"maintainers":[{"name":"stevefar","email":""}],"publish_time":1390930926900,"_hasShrinkwrap":false,"_cnpm_publish_time":1390930926900,"_cnpmcore_publish_time":"2021-12-16T17:44:29.838Z"}},"readme":"# Node.js Intercept stdout\n\n> intercept-stdout captures or modifies stdout and/or stderr.\n\n> _<sup>Based on [this](https://gist.github.com/benbuckman/2758563) gist</sup>_\n\n## Capture\n```javascript\nvar intercept = require(\"intercept-stdout\"),\n\tcaptured_text = \"\";\n\nvar unhook_intercept = intercept(function(txt) {\n\tcaptured_text += txt;\n});\n\nconsole.log(\"This text is being captured\");\n\n// Let's stop capturing stdout.\nunhook_intercept();\n\nconsole.log(\"This text is not being captured\");\n```\n\n## Modify\n```javascript\nvar intercept = require(\"intercept-stdout\");\n\nvar unhook_intercept = intercept(function(txt) {\n\treturn txt.replace( /this/i , 'that' );\n});\n\nconsole.log(\"This text is being modified\");\n// -> that text is being modified\n```\n\n## Test\n\n\tnpm install\n\tnpm test\n\n## Separating Error Text\n\nStarting in Version 0.1.2, you may now specify two interceptor callbacks. If a second interceptor callback is specified, the second callback will be invoked for `stderr` output.\n\n## Errors and Warnings\n\nVersions > 0.1.1 hook both `stdout` and `stderr`. This change enables capturing of `console.log`, `console.info`, `console.warn`, and `console.error`. This change may break pre-existing interceptors if your interceptor expected output to be a full line of text.\n\n## About Colorization\n\nPopular modules such as [`mocha`](http://mochajs.org/) and [`winston`](https://github.com/winstonjs/winston) may colorize output by inserting ANSI escape codes into the output stream. Both `mocha` and `winston` make multiple calls to the output streams while colorizing a line -- in order to be robust, your code should anticipate and deal with this.\n","_attachments":{},"homepage":"https://github.com/sfarthin/intercept-stdout","bugs":{"url":"https://github.com/sfarthin/intercept-stdout/issues"},"license":"MIT"}