iam-medvedev / ntpc

Tiny NTP Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License: WTFPL TypeScript code style: prettier npm version semantic-release

ntpc

Tiny NTP client. Works with NTP v3 and v4

Installation

yarn add ntpc

Usage

import { getTime } from 'ntpc';

const { currentTime } = await getTime('time.apple.com', 123);
console.log(currentTime); // Date(2023-06-08T06:46:08.000Z)

Configuration

import { getTime } from 'ntpc';

const { currentTime } = await getTime('time.apple.com', 123, {
  version: 3,
});
console.log(currentTime); // Date(2023-06-08T06:46:08.000Z)

License

ntpc is WTFPL licensed.

About

Tiny NTP Client

License:Do What The F*ck You Want To Public License


Languages

Language:TypeScript 99.1%Language:Shell 0.9%