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.
akamai-time-reference
Advanced tools
akamai-time-reference
is a Node.js package to get the exact current time using
Akamai's Time Reference service.
It has only two depedencies :
const timeRef = require('akamai-time-reference');
timeRef.now().then(function(now) {
console.log(now);
});
// >> Tue Sep 15 2015 21:36:53 GMT+0200 (CEST)
timeRef.now().then(function(refNow) {
console.log('Local clock desync ins ms : %d', Date.now() - refNow);
});
// >> Local clock desync ins ms : 12765
The now()
function can be passed an argument, which, if true, will skip the cache (to force a HTTP request).
const timeRef = require('akamai-time-reference');
timeRef.now();
// >> HTTP request
timeRef.now();
// >> NO HTTP request, used cache
timeRef.now(true);
// >> HTTP request
You can change some options like using setOptions
by passing it an object with
one/some of theses properties :
timeRef.setOptions({
cacheTTL: 5000, // How often do we make a request to akamai, in ms (<=0 to disable)
useHTTP: false, // Use the HTTP protocol instead of HTTP**S**
timeout: 2000, // Request timeout value, in ms
});
// or just one :
timeRef.setOptions({ cacheTTL: 1000 });
(Above example gives you the default values).
Changing an/some options is done for every future calls (in the process), globally.
setOptions
will return the current options (You can pass an empty object to just get them).
FAQs
Get a time reference using Akamai's platform
The npm package akamai-time-reference receives a total of 1 weekly downloads. As such, akamai-time-reference popularity was classified as not popular.
We found that akamai-time-reference 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.