# ntpclient

> A TypeScript implementation of the NTP Client Protocol

Latest version **1.16.15** (published 2026-11-05) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install ntpclient
pnpm add ntpclient
yarn add ntpclient
bun add ntpclient
```

Provides the command `ntpclient`.

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.16.15 |
| Published | 2026-11-05 |
| First published | 2017-09-03 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | ESM |
| Node | >= 22.12.0 |
| Dependencies | 1 |
| Unpacked size | 42.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 17 |
| Author | Florian Imdahl |
| Maintainers | ffflorian |

## Links

- npm: https://www.npmjs.com/package/ntpclient
- Repository: https://github.com/ffflorian/node-packages
- Homepage: https://github.com/ffflorian/node-packages#readme
- Issues: https://github.com/ffflorian/node-packages/issues
- npm.io page: https://npm.io/package/ntpclient

## Dependencies (1)

- [commander](https://npm.io/package/commander.md) 15.0.0

## Recent versions

- 1.16.15 (latest) — 2026-11-05
- 1.16.14 — 2026-10-29
- 1.16.13 — 2026-10-25
- 1.16.12 — 2026-10-22
- 1.16.11 — 2026-10-22
- 1.16.10 — 2026-10-16
- 1.16.9 — 2026-10-15
- 1.16.8 — 2026-10-08
- 1.16.7 — 2026-10-02
- 1.16.6 — 2026-09-25
- 1.16.5 — 2026-09-17
- 1.16.4 — 2026-09-10
- 1.16.3 — 2026-05-28
- 1.16.2 — 2026-05-22
- 1.16.1 — 2026-03-28
- … 90 more at https://npm.io/package/ntpclient/versions

## README

# NTPClient [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![npm version](https://img.shields.io/npm/v/ntpclient.svg?style=flat)](https://www.npmjs.com/package/ntpclient)

TypeScript implementation of the NTP Client Protocol. Based on [node-ntp-client](https://github.com/moonpyk/node-ntp-client).

## Prerequisites

- [Node.js](https://nodejs.org)
- npm (preinstalled) or [yarn](https://yarnpkg.com)

## Installation

ℹ️ This is a pure [ESM](https://nodejs.org/api/esm.html#introduction) module.

Run `yarn add ntpclient` or `npm i ntpclient`.

```ts
import {NTPClient} from 'ntpclient';

new NTPClient()
  .getNetworkTime()
  .then(date => console.log(date)) // 2017-09-20T15:29:09.443Z
  .catch(err => console.error(err));

// or

new NTPClient({
  server: 'de.pool.ntp.org',
  port: 123,
  replyTimeout: 40 * 1000, // 40 seconds
})
  .getNetworkTime()
  .then(date => console.log(date)) // 2017-09-20T15:29:09.443Z
  .catch(err => console.error(err));

// or

new NTPClient('de.pool.ntp.org', 123, 40 * 1000)
  .getNetworkTime()
  .then(date => console.log(date)) // 2017-09-20T15:29:09.443Z
  .catch(err => console.error(err));
```

---
_Source: https://npm.io/package/ntpclient · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
