Skip to content

iam-medvedev/ntpc

Repository files navigation

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.