
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@kerasus/server-date
Advanced tools
This version has been rewritten and breaks compatibility with the previous API.
server-date makes the server's clock available to the client's web browser in JavaScript.
You can use it when you want to display the current time but don't trust the browser's clock to be accurate or to synchronize events for different users of your web site by syncing them all to the server's clock.
There are two implementations. The simplest one, serverDate.js
, gets the time
from the server on which the library is hosted by reading the
Date HTTP response
header. You don't need to make any changes on the server if you use this version
but its precision is limited to seconds because that's what's available in the
header.
If you want millisecond precision, and your server can process PHP, then you can
use the serverDate.js.php
version which will give you precision on the order
of milliseconds.
import { getServerDate } from "./serverDate.js";
const { date, offset, uncertainty } = await getServerDate();
console.log(`The server's date is ${date} +/- ${uncertainty} milliseconds.`);
// some time in the future
const serverDate = new Date(Date.now() + offset);
See example.html
for a complete example.
Copyright 2012 David Braun
FAQs
Make the server's clock available in the browser.
The npm package @kerasus/server-date receives a total of 1 weekly downloads. As such, @kerasus/server-date popularity was classified as not popular.
We found that @kerasus/server-date 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.