A simple NTP client implementation for Bun
https://www.npmjs.com/package/buntp
- TypeScript 100%
| examples | ||
| src | ||
| .gitignore | ||
| .npmignore | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
buntp
🧅 A simple NTP client implementation for Bun
This implementation was done following the RFC 4330.
Installation
bun add buntp
Usage
import { NTPClient } from "buntp";
const client = new NTPClient("your ntp server address");
let date = await client.sync(); // Returning a Date object
let rawRes = await client.rawSync(); // Returning a Packet object (see definition at src/models.ts)