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