Skip to content

Releases: buffcode/ntp-time-sync

v0.6.0

Choose a tag to compare

@buffcode buffcode released this 01 Jul 15:52

Pre-release hardening pass over the core NTP client, plus a full offline test suite and packaging verification in CI.

Fixes & hardening

  • Instance-scoped state — cache/singleton state moved off module scope; independent new NtpTimeSync(...) instances no longer cross-contaminate.
  • Signed clock offset (RFC 5905) — offset now uses ((T2-T1) + (T3-T4))/2 instead of an abs()+heuristic-sign form that returned the wrong result on asymmetric paths.
  • IPv6-aware server parsing — supports bracketed IPv6 [::1][:port], bare IPv6 literals, and the existing host / host:port / IPv4[:port] forms with port-range validation.
  • Stricter option validation — unknown constructor options now throw Invalid option: <key> instead of being silently ignored.
  • Robustness — register the message listener before send (fixes a fast-reply race), count retries on no-progress rounds, and harden socket/listener cleanup on error paths.
  • createPacket rewrite — uses Buffer.writeBigUInt64BE, dropping deprecated substr and per-packet string allocations.

Public API

  • src/index.ts uses explicit named exports and NtpTimeSyncDefaultOptions is deep-frozen. Same 5 names, runtime mutation blocked.

Dependencies

  • ntp-packet-parser bumped to ^0.6.1.

Tooling / CI

  • 32 offline unit tests (in-process UDP fixture) covering packet construction, response validation, sample math, instance isolation, retry bounds, socket-leak regression, option validation, and server parsing.
  • New verify-package CI job runs npm pack, publint, and attw (0.18.4) to catch exports/files/types regressions before publish.

⚠️ Breaking changes

  • Unknown constructor options now throw instead of being ignored.
  • Computed offsets change for asymmetric network paths (signed RFC 5905 formula).
  • src/index.ts no longer re-exports via export *: RecursivePartial is no longer exported and NtpTimeResult is type-only.

Full changelog: 0.5.0...0.6.0

0.5.0

Choose a tag to compare

@buffcode buffcode released this 08 Apr 06:59

⚠️ Breaking change: Dropped support for node <18

  • feat: Drop Node <18, support v22, pin dev-dependencies by @buffcode in #99

What's Changed

  • build(deps-dev): bump prettier from 3.2.4 to 3.2.5 by @dependabot in #73
  • build(deps-dev): bump typescript from 5.3.3 to 5.4.2 by @dependabot in #74
  • build(deps-dev): bump typescript from 5.4.2 to 5.4.3 by @dependabot in #75
  • build(deps-dev): bump typescript from 5.4.3 to 5.4.4 by @dependabot in #76
  • build(deps-dev): bump typescript from 5.4.4 to 5.4.5 by @dependabot in #77
  • build(deps-dev): bump prettier from 3.2.5 to 3.3.0 by @dependabot in #78
  • build(deps-dev): bump prettier from 3.3.0 to 3.3.1 by @dependabot in #79
  • build(deps-dev): bump prettier from 3.3.1 to 3.3.2 by @dependabot in #80
  • build(deps-dev): bump typescript from 5.4.5 to 5.5.2 by @dependabot in #81
  • build(deps-dev): bump typescript from 5.5.2 to 5.5.3 by @dependabot in #82
  • build(deps-dev): bump prettier from 3.3.2 to 3.3.3 by @dependabot in #83
  • build(deps-dev): bump typescript from 5.5.3 to 5.5.4 by @dependabot in #84
  • build(deps-dev): bump typescript from 5.5.4 to 5.6.2 by @dependabot in #85
  • build(deps-dev): bump typescript from 5.6.2 to 5.6.3 by @dependabot in #86
  • build(deps-dev): bump typescript from 5.6.3 to 5.7.2 by @dependabot in #88
  • build(deps-dev): bump prettier from 3.3.3 to 3.4.1 by @dependabot in #89
  • build(deps-dev): bump prettier from 3.4.1 to 3.4.2 by @dependabot in #90
  • build(deps-dev): bump typescript from 5.7.2 to 5.7.3 by @dependabot in #91
  • build(deps-dev): bump prettier from 3.4.2 to 3.5.0 by @dependabot in #92
  • build(deps-dev): bump prettier from 3.5.0 to 3.5.1 by @dependabot in #93
  • build(deps-dev): bump prettier from 3.5.1 to 3.5.2 by @dependabot in #94
  • ci: Updated workflows by @buffcode in #98
  • build(deps-dev): bump prettier from 3.5.2 to 3.5.3 by @dependabot in #96
  • build(deps-dev): bump typescript from 5.7.3 to 5.8.3 by @dependabot in #97
  • feat: Drop Node <18, support v22, pin dev-dependencies by @buffcode in #99

Full Changelog: 0.4.1...0.5.0

0.4.1

Choose a tag to compare

@buffcode buffcode released this 25 Jan 10:53

What's Changed

  • build(deps-dev): bump typescript from 5.1.6 to 5.2.2 by @dependabot in #61
  • build(deps): bump ntp-packet-parser from 0.3.0 to 0.3.1 by @dependabot in #62
  • build(deps-dev): bump prettier from 3.0.2 to 3.0.3 by @dependabot in #63
  • build(deps-dev): bump prettier from 3.0.3 to 3.1.0 by @dependabot in #64
  • build(deps-dev): bump typescript from 5.2.2 to 5.3.2 by @dependabot in #65
  • build(deps-dev): bump typescript from 5.3.2 to 5.3.3 by @dependabot in #66
  • build(deps-dev): bump ts-node from 10.9.1 to 10.9.2 by @dependabot in #67
  • build(deps-dev): bump prettier from 3.1.0 to 3.1.1 by @dependabot in #68
  • build(deps-dev): bump prettier from 3.1.1 to 3.2.2 by @dependabot in #70
  • build(deps-dev): bump prettier from 3.2.2 to 3.2.4 by @dependabot in #71
  • feat: Support Node v20 by @buffcode in #72

Full Changelog: 0.3.1...0.4.1

v0.3.1

Choose a tag to compare

@buffcode buffcode released this 22 Aug 07:55

v0.3.0

Choose a tag to compare

@buffcode buffcode released this 12 Nov 20:18
  • Dropped Node v12 support
  • Added Node v18 support (#37)

v0.2.1

Choose a tag to compare

@buffcode buffcode released this 01 Apr 09:01

Maintenance release

v0.2.0

Choose a tag to compare

@buffcode buffcode released this 16 May 22:29

Refactored to TypeScript, Github actions for publishing and tests.

Breaking changes:

  • there are no default exports anymore, please use import { NtpTimeSync } from "ntp-time-sync" syntax.