redirect-output
Provides a way to redirect the output stream (stdout/stderr) to a file.
Installation:
npm install redirect-output
Usage
For example you could use the following code:
;; ; ; output.writefile; // Write some text to file and stdout/stderrconsole.log'text'; // Restoring original outputoutput.reset; // Write some text to stdout onlyconsole.log'text';
API
.constructor(options?: IOptions): void
interface IOptions
See fs.WriteStream
.write(file: string): void
Redirect the output stream to a file.
.reset(): void
Restore original streams.
Tests
npm test
Debug
DEBUG=redirect-output npm test
Publication
npm test
npm publish
License
MIT