strip-chromium-logs
v1.0.2
Published
strips chromium logs from a stream
Downloads
74
Maintainers
Readme
strip-chromium-logs
Strips Chromium logs from a stream, mainly useful for cleaning up Electron's process.stderr
stream.
Install
npm install strip-chromium-logs --save
Example
var proc = require('child_process')
var electron = require('electron-prebuilt')
var logger = require('strip-chromium-logs')
var path = require('path')
var args = process.argv.slice(2)
var server = path.resolve(__dirname, 'server.js')
// spawn electron and print debugging to console
var p = proc.spawn(electron, [ server ].concat(args))
p.stdout.pipe(process.stdout)
p.stderr.pipe(logger()).pipe(process.stderr)
Before strip-chromium-logs
:
After strip-chromium-logs
:
Usage
stripChromiumLogs()
Returns a duplexer stream which ignores Chromium-looking logs (which can span several lines) but allows other lines to pass through.
License
MIT, see LICENSE.md for details.