Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@dnlup/doc
Advanced tools
Get usage and health data about your Node.js process
$ npm i @dnlup/doc
const Doc = require('@dnlup/doc');
const doc = Doc(); // Use the default sample interval
doc.on('data', data => {
doStuffWithCpuUsage(data.cpu)
doStuffWithMemoryUsage(data.memory)
doStuffWithEventLoopDelay(data.eventLoopDelay)
})
Create a new Doc instance with the given options.
options
: Object
. Optional. Configuration objectoptions.sampleInterval
: Number
. Optional. Sample interval (ms), each sampleInterval
ms a data event is emitted. On Node 10 the default value is 500
while on Node >= 12 is 1000
. Under the hood the package uses monitorEventLoopDelay
where available to sample the event loop and this allows to increase the default sample interval on Node >= 12.options.eventLoopOptions
: Object
. Optional. Options to setup monitorEventLoopDelay
Process data event.
Properties:
Name | Description |
---|---|
eventLoopDelay | Event loop delay (ms) |
memory | Object containing memory usage stats |
memory.rss | RSS memory (bytes) |
memory.heapTotal | Total heap Memory (bytes) |
memory.heapUsed | Heap memory used (bytes) |
memory.external | Extarnal memory (bytes) |
cpu | Cpu usage percentage |
raw | Object containing raw values |
raw.cpu | Object containing the raw values returned from process.cpuUsage() |
raw.eventLoopDelay | Raw representation of the event loop delay, on Node 10 it is the delay in nanoseconds, on Node >= 12 is a Histogram instance |
FAQs
Get usage and health data about your Node.js process
The npm package @dnlup/doc receives a total of 229 weekly downloads. As such, @dnlup/doc popularity was classified as not popular.
We found that @dnlup/doc demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.