Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
performance-plus
Advanced tools
A utility and convenience library for the browser-based performance API, with support for IE8+
This is a utility and convenience library for the browser-based performance API, with support for IE8+ and zero dependencies.
The performance API allows for sub-millisecond, high-resolution timestamp measurements. This library adds some basic statistical helpers while collecting that data in slightly better style. In browsers below Internet Explorer 10, the performance API is unsupported. This library pseudo-fills that hole with plain old objects to deliver the same interface, just not at sub-millisecond resolution.
import perf from 'performance-plus';
var action = 'foobar';
perf.start(action); // capture start timestamp
func(); // this thing takes some time
perf.end(action); // capture ending timestamp
// repeat the above loop a few times
console.log(`[perf] action ${action}`,
`took ${perf.duration(action).toFixed(2)}ms`, {
mean: perf.mean(action),
sdev: perf.sdev(action),
sampleSize: perf.getEntriesByName(action).length,
'95th_perc': perf.percentile(action, 0.95)
});
// It can also measure FPS rendering
perf.onFPS((fps, time) => {
console.log(`It is now ${time} and we are rendering at ${fps} frames per second`);
}, 2000); // measure and call every 2 seconds
$ npm install performance-plus
Commonly used methods:
perf.now(); // high-res timestamp
perf.start('something');
perf.end('something');
perf.duration('something'); // in ms
perf.mean('something'); // in ms
perf.sdev('something'); // in ms
perf.getEntriesByName('something'); // all measures for this name
perf.getEntryByName('something'); // last measure for this name
FAQs
A utility and convenience library for the browser-based performance API, with support for IE8+
The npm package performance-plus receives a total of 2 weekly downloads. As such, performance-plus popularity was classified as not popular.
We found that performance-plus 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.