
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.
@probe.gl/stats
Advanced tools
@probe.gl/stats is a JavaScript library designed for performance monitoring and statistics collection. It provides tools to track and analyze various metrics, making it useful for performance optimization and debugging in web applications.
Stat Tracking
This feature allows you to track various statistics, such as frame rates, memory usage, or any custom metrics. The code sample demonstrates how to create a Stats object, increment a frame rate counter, and log the count.
const { Stats } = require('@probe.gl/stats');
const stats = new Stats({id: 'app-stats'});
stats.get('frameRate').incrementCount();
console.log(stats.get('frameRate').count);
Timer
This feature allows you to measure the time taken for specific operations. The code sample shows how to start and end a timer for a 'loadTime' metric and log the last timing.
const { Stats } = require('@probe.gl/stats');
const stats = new Stats({id: 'app-stats'});
stats.get('loadTime').timeStart();
// Perform some operations
stats.get('loadTime').timeEnd();
console.log(stats.get('loadTime').lastTiming);
Aggregated Stats
This feature allows you to aggregate statistics over time. The code sample demonstrates how to add counts to a 'requests' metric and log the total count.
const { Stats } = require('@probe.gl/stats');
const stats = new Stats({id: 'app-stats'});
stats.get('requests').addCount(5);
stats.get('requests').addCount(3);
console.log(stats.get('requests').count);
stats.js is a lightweight JavaScript library for monitoring performance metrics such as frame rate, memory usage, and custom metrics. It provides a simple interface and visual display for real-time performance tracking. Compared to @probe.gl/stats, stats.js is more focused on real-time visualization and is often used in game development and interactive applications.
perf_hooks is a Node.js module that provides an API for measuring performance metrics. It includes high-resolution timers and performance observers for tracking various performance-related events. While @probe.gl/stats is more specialized for web applications and custom metrics, perf_hooks offers a broader range of performance measurement tools suitable for Node.js environments.
performance-now is a simple library that provides a high-resolution timer for measuring performance in JavaScript. It is often used for benchmarking and performance analysis. Compared to @probe.gl/stats, performance-now is more focused on providing precise timing information rather than a comprehensive statistics tracking system.
FAQs
Stats object for reporting performance statistics
The npm package @probe.gl/stats receives a total of 366,373 weekly downloads. As such, @probe.gl/stats popularity was classified as popular.
We found that @probe.gl/stats demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
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.