
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
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
The npm package console-monkey-patch receives a total of 23 weekly downloads. As such, console-monkey-patch popularity was classified as not popular.
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.