stdout-stderr
TypeScript icon, indicating that this package has built-in type declarations

0.1.13 • Public • Published

stdout-stderr

mock stdout and stderr

Version Known Vulnerabilities Downloads/week License

Usage:

const {stdout, stderr} = require('stdout-stderr')
 
stdout.start()                                // start mocking stdout
console.log('writing to stdout')              // this will not be displayed
stdout.stop()                                 // stop mocking stdout
assert(stdout.output === 'writing to stdout') // view the output
 
 
/* options */
stdout.stripColor = false // disable automatic ansi code stripping
stdout.print = true       // also output to screen

This uses the debug module so you can also see the output by setting DEBUG=stdout|stderr|*.

Readme

Keywords

Package Sidebar

Install

npm i stdout-stderr

Weekly Downloads

187,538

Version

0.1.13

License

MIT

Unpacked Size

6.54 kB

Total Files

5

Last publish

Collaborators

  • dickeyxxx