Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Installs process.stdout
and process.stderr
and redirects console
.
Repository: https://github.com/mantoni/brout.js
npm install brout
Assume my-script.js
contains this:
process.stdout.write('Hello stdout!\n');
console.log('Hello %s!', 'console');
Use with browserify and phantomic:
$ browserify -t brout my-script.js | phantomic
Hello stdout!
Hello console!
Headless testing with Mocha requires mocaccino:
$ browserify -t brout my-test.js | mocaccino -b -r spec | phantomic
var brout = require('brout');
brout.on('out', function (str)) {
// ...
});
brout.on('err', function (str)) {
// ...
});
brout.on('exit', function (code)) {
// ...
});
Event listeners are tiggered by these calls:
process.stdout.write(string)
process.stderr.write(string)
process.exit(code)
The console functions log
, info
, warn
and error
get replaced and the
original implementation is exposed:
console.log.original
console.info.original
console.warn.original
console.error.original
The console override behaves like node's implementation and writes to
process.stdout
and process.sterr
.
If an out
or err
listener is installed, then the corresponding console
message is no longer forwarded to the original console implementation.
MIT
FAQs
stdout and stderr for browsers
We found that brout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.