Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
console-monkey-patch
Advanced tools
Hack the console object methods (like log, error, info etc.).
In Node.js it is sometime desirable to redirect console.log
& Co. calls to a
given stream but not possible to actually replace stdout
and/or stderr
.
This module allow to override console
methods in a simple way.
npm install console-monkey-patch
The most simple example is to create a new console.Console
object (see
https://nodejs.org/api/console.html#console_class_console):
var fs = require("fs");
var newstdout = fs.createWriteStream('/tmp/stdout.log', {flags: 'a'});
var newstderr = fs.createWriteStream('/tmp/stderr.log', {flags: 'a'});
var newcons = new console.Console(newstdout, newstderr);
require("console-monkey-patch")(newcons);
console.log('this should go to /tmp/stdout.log');
console.error('this should go to /tmp/stderr.log');
The module only override the console
methods documented at
https://nodejs.org/api/console.html and does not replace process.stdout
and
process.stderr
. As a result, code (including modules) using directly theses
streams won't be "affected".
MIT, see MIT-LICENSE.
FAQs
Node.js module monkeypatching the console object
We found that console-monkey-patch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.