Releases: buffcode/ntp-time-sync
Releases · buffcode/ntp-time-sync
Release list
v0.6.0
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))/2instead of anabs()+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 existinghost/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. createPacketrewrite — usesBuffer.writeBigUInt64BE, dropping deprecatedsubstrand per-packet string allocations.
Public API
src/index.tsuses explicit named exports andNtpTimeSyncDefaultOptionsis deep-frozen. Same 5 names, runtime mutation blocked.
Dependencies
ntp-packet-parserbumped 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-packageCI job runsnpm pack,publint, andattw(0.18.4) to catchexports/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.tsno longer re-exports viaexport *:RecursivePartialis no longer exported andNtpTimeResultis type-only.
Full changelog: 0.5.0...0.6.0
0.5.0
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
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
v0.3.0
v0.2.1
Maintenance release
- minimum node version increased to v12 (oldest version which is still in maintenance)
- included dev-dependency updates: