ntpy
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

ntpy Travis CI Build Status

NTP client for Node.js.

NPM Badge

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.

Package Sidebar

Install

npm i ntpy

Weekly Downloads

7

Version

1.0.0

License

MIT

Unpacked Size

6 kB

Total Files

6

Last publish

Collaborators

  • richienb