
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Report metrics based on events generated by a given event emitter. Supports StatsD, Cloudwatch & custom backends.
Install using npm
npm install metromatic
var Metromatic = require('metromatic');
const backends = [
{
type: 'statsd',
host: 'localhost',
port: 8125
},
{
type: 'cloudwatch'
region: 'us-west-1',
groupName: 'MyService'
dimensions: { environment: NODE_ENV },
accessKeyId: AWS_CLOUDWATCH_KEY_ID,
secretAccessKey: AWS_CLOUDWATCH_ACCESS_KEY,
},
{
type: 'custom',
send: (type, name, data) => {
// handle metric storage
},
}
];
Metromatic.instrument(myEventEmitter, {
backends: backends,
metrics: [{
name: 'request_time',
type: 'timing', // timing or gauge currently supported
eventStart: 'request',
eventStop: 'response'
}, {
name: 'gauge_foo',
type: 'gauge',
eventGauge: 'hey'
}]
});
Eventually, timings and gauges metrics will be sent when myEventEmitter
emits the request
and response
events (for timing) or hey
event (for gauge).
If you just want to stop listening the object:
Metromatic.restore(myEventEmitter);
To keep track of multiple timings of the same event pass any id string as a parameter when emitting the events to differentiate them.
Run the tests using
npm test
At the moment supports timing
and gauges
metric types. You're more than welcome to express some code love in a Pull Request to make it even more awesome.
Also, if you feel like something is quite not right or want to suggest something, leave us an open issue.
FAQs
Listen events on an object and report metrics to StatsD
The npm package metromatic receives a total of 0 weekly downloads. As such, metromatic popularity was classified as not popular.
We found that metromatic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.