Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
browser-process-hrtime
Advanced tools
The browser-process-hrtime package is a browser shim for Node.js's process.hrtime. It allows you to get high-resolution real-time stamps with nanosecond precision, which is useful for performance testing, benchmarking, or tracking the time between events with high accuracy.
High-resolution time stamps
This feature allows you to measure precise time intervals. The code sample demonstrates how to get the current high-resolution real-time stamp, wait for 1 second using setTimeout, and then get another time stamp to calculate the duration.
const now = require('browser-process-hrtime');
const start = now();
setTimeout(function () {
const end = now(start);
console.log('seconds:', end[0]);
console.log('nanoseconds:', end[1]);
}, 1000);
This package provides a function that returns the current timestamp in milliseconds. It's similar to browser-process-hrtime but does not provide nanosecond precision.
hrtime is another shim for process.hrtime. It offers similar functionality to browser-process-hrtime, providing high-resolution real-time stamps.
nano-time gives you the current time in nanoseconds as a string. It's similar to browser-process-hrtime in that it provides high precision timing, but it does not use the same API as process.hrtime.
Browser shim for Node.js process.hrtime(). See documentation at nodejs.org
You can monkey-patch process.hrtime for your dependency graph like this
process.hrtime = require('browser-process-hrtime')
var coolTool = require('module-that-uses-hrtime-somewhere-in-its-depths')
This was originally pull-requested against node-process, but they are trying to stay lean.
FAQs
Shim for process.hrtime in the browser
The npm package browser-process-hrtime receives a total of 4,153,282 weekly downloads. As such, browser-process-hrtime popularity was classified as popular.
We found that browser-process-hrtime 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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.