NTP client for Node.js.
npm install ntpy
const ntpy = require("ntpy");
(async () => {
const { receiveTimestamp } = await ntpy("pool.ntp.org");
console.log("The date is: ", receiveTimestamp);
})();
Type: string
The url of a NTP server to use.
Type: object
Type: number
Default: 123
The port to use when connecting to the NTP server.
Type: number | false
Default: 10000
The timeout in milliseconds for the request to complete. Set to false
to disable.