
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@smarterservices/smarterclock
Advanced tools
store of delta values between ntp time and local time to get an accurate sync time
Used to ensure the time used is in sync across distributed systems. The sync is achived by the following process:
##Getting Started Install the module.
npm install @smarterservices/smarterclock
Import the module into your codebase
var smarterclock = require('@smarterservices/smarterclock')
Create an instance of the clock object passing in the required params. See the options section below for options that can be used.
var options = {};
// create a new instance
var clock = new smarterclock(options);
// get the current unix timestamp
var currentTime = clock.getTime();
console.log(currentTime);
The clock constructor can accept the following options. all options are optional
syncDelay
(number) : The time (in seconds) between each call to an NTP server to get the latest UTC timestamp. Defaults to 300 (which is 5 minutes).history
(number): The nubmer of delta values that should be maintained and used for calculating your local time drift. Defaults to 10.servers
(array) : An array of NTP servers to use when looking up time. Each value in the array should be an object with the keys server
and port
. Defaults to pool.ntp.org.{
"syncDelay" : 60,
"history": 10,
"servers" : [{"server": "pool.ntp.org", "port": 123}]
}
###getTime()
Returns unix timestamp based on delta values between server and your local time. This is the time that can be used instead of new Date().getTime()
clock.getTime();
###syncTime()
An on-demand method that will force a sync with an NTP server.
clock.syncTime();
FAQs
store of delta values between ntp time and local time to get an accurate sync time
The npm package @smarterservices/smarterclock receives a total of 0 weekly downloads. As such, @smarterservices/smarterclock popularity was classified as not popular.
We found that @smarterservices/smarterclock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.