Tiny NTP client. Works with NTP v3 and v4
yarn add ntpc
import { getTime } from 'ntpc';
const { currentTime } = await getTime('time.apple.com', 123);
console.log(currentTime); // Date(2023-06-08T06:46:08.000Z)
import { getTime } from 'ntpc';
const { currentTime } = await getTime('time.apple.com', 123, {
version: 3,
});
console.log(currentTime); // Date(2023-06-08T06:46:08.000Z)
ntpc
is WTFPL licensed.