
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.
Little helper module for translating events into log messages.
Will perfectly work with NodeJS 4.0.0 and above.
'use strict';
const events = require( 'events' );
const event2log = require( 'event2log' );
// First we create a dummy instance. It might be anything emitting events.
// This is the instance you are willing to observe and log upon emitted events.
let instanceThrowingEvents = new events.EventEmitter();
// The translation table converts events into human-readable strings.
// The field name corresponds to an event name. The field itself accommodates a
// function that receives the event arguments and alway will return an array!
// The first argument of that array names a logging method and the following
// items will be passed to logging method as arguments.
const translationTable = {
'event1': ( a, b ) => [ 'log', `Hello ${a}! Are you afraid of ${b}?` ],
'event2': ( c ) => [ 'error', `${c} is watching you!` ]
};
// The following statement bundles everything together. For testing purposes it
// just prints stuff to the console. But you also could replace the 'console' by
// something more sophisticated (or bloated?) like 'winston'.
let e2lHandler = event2log( translationTable, instanceThrowingEvents, console );
instanceThrowingEvents.emit( 'event1', "World", "Chuck Norris" );
// Will print to stdout: Hello World! Are you afraid of Chuck Norris?
instanceThrowingEvents.emit( 'event2', "Big Brother" );
// Will print to stderr: Big Brother is watching you!
// Calling the returned e2lHandler releases all listening events bound by
// event2log.
e2lHandler();
instanceThrowingEvents.emit( 'event1', "Universe", "human beings" );
// Won't print anything to the console.
FAQs
Translates events to human-readable log
The npm package event2log receives a total of 0 weekly downloads. As such, event2log popularity was classified as not popular.
We found that event2log 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.
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.