diff -Nru node-sntp-3.1.2/API.md node-sntp-4.0.0/API.md --- node-sntp-3.1.2/API.md 1970-01-01 00:00:00.000000000 +0000 +++ node-sntp-4.0.0/API.md 2020-01-10 05:16:44.000000000 +0000 @@ -0,0 +1,74 @@ + +## Introduction + +An SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time +along with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset +to the local time. + +## Usage + +```javascript +const Sntp = require('@hapi/sntp'); + +// All options are optional + +const options = { + host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org + port: 123, // Defaults to 123 (NTP) + resolveReference: true, // Default to false (not resolving) + timeout: 1000 // Defaults to zero (no timeout) +}; + +// Request server time + +const exec = async function () { + + try { + const time = await Sntp.time(options); + console.log('Local clock is off by: ' + time.t + ' milliseconds'); + process.exit(0); + } + catch (err) { + console.log('Failed: ' + err.message); + process.exit(1); + } +}; + +exec(); +``` + +If an application needs to maintain continuous time synchronization, the module provides a stateful method for +querying the current offset only when the last one is too old (defaults to daily). + +```javascript +// Request offset once + +const exec = async function () { + + const offset1 = await Sntp.offset(); + console.log(offset1); // New (served fresh) + + // Request offset again + + const offset2 = await Sntp.offset(); + console.log(offset2); // Identical (served from cache) +}; + +exec(); +``` + +To set a background offset refresh, start the interval and use the provided now() method. If for any reason the +client fails to obtain an up-to-date offset, the current system clock is used. + +```javascript +const before = Sntp.now(); // System time without offset + +const exec = async function () { + + await Sntp.start(); + const now = Sntp.now(); // With offset + Sntp.stop(); +}; + +exec(); +``` diff -Nru node-sntp-3.1.2/CHANGELOG.md node-sntp-4.0.0/CHANGELOG.md --- node-sntp-3.1.2/CHANGELOG.md 2019-08-15 01:06:10.000000000 +0000 +++ node-sntp-4.0.0/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -Breaking changes are documented using GitHub issues, see [issues labeled "release notes"](https://github.com/hapijs/sntp/issues?q=is%3Aissue+label%3A%22release+notes%22). - -If you want changes of a specific minor or patch release, you can browse the [GitHub milestones](https://github.com/hapijs/sntp/milestones?state=closed&direction=asc&sort=due_date). diff -Nru node-sntp-3.1.2/debian/changelog node-sntp-4.0.0/debian/changelog --- node-sntp-3.1.2/debian/changelog 2019-09-05 09:26:59.000000000 +0000 +++ node-sntp-4.0.0/debian/changelog 2020-06-13 17:25:02.000000000 +0000 @@ -1,3 +1,16 @@ +node-sntp (4.0.0-1) unstable; urgency=medium + + * Team upload + * Declare compliance with policy 4.5.0 + * Add "Rules-Requires-Root: no" + * Add debian/gbp.conf + * Add upstream/metadata + * Update dependencies (Closes: #952143) + * New upstream version 4.0.0 + * Require node-hoek ≥ 9 + + -- Xavier Guimard Sat, 13 Jun 2020 19:25:02 +0200 + node-sntp (3.1.2-2) unstable; urgency=medium * Team upload diff -Nru node-sntp-3.1.2/debian/control node-sntp-4.0.0/debian/control --- node-sntp-3.1.2/debian/control 2019-09-04 23:02:59.000000000 +0000 +++ node-sntp-4.0.0/debian/control 2020-02-29 13:41:24.000000000 +0000 @@ -7,24 +7,21 @@ debhelper-compat (= 12) , dh-buildinfo , nodejs (>= 10) - , node-hapi-hoek (>= 8.0.0) - , node-hapi-bounce (>= 1.0.0) - , node-hapi-boom (>= 7.0.0) - , node-hapi-teamwork (>= 3.0.0) -Standards-Version: 4.4.0 + , node-boom (>= 9), + , node-hoek (>= 9) +Standards-Version: 4.5.0 Homepage: https://github.com/hueniverse/sntp#readme Vcs-Git: https://salsa.debian.org/js-team/node-sntp.git Vcs-Browser: https://salsa.debian.org/js-team/node-sntp +Rules-Requires-Root: no Package: node-sntp Architecture: all Depends: ${misc:Depends} , nodejs (>= 10) - , node-hapi-hoek (>= 4.0.0) - , node-hapi-bounce (>= 1.0.0) - , node-hapi-boom (>= 7.0.0) - , node-hapi-teamwork (>= 3.0.0) + , node-hoek (>= 9) + , node-boom (>= 9) Provides: node-hapi-sntp (=${source:Version}) Description: SNTP client An SNTP v4 client (RFC4330) for nodejs. Simpy connects to the NTP or SNTP diff -Nru node-sntp-3.1.2/debian/gbp.conf node-sntp-4.0.0/debian/gbp.conf --- node-sntp-3.1.2/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ node-sntp-4.0.0/debian/gbp.conf 2020-02-28 11:01:26.000000000 +0000 @@ -0,0 +1,5 @@ +[DEFAULT] +pristine-tar = True + +[import-orig] +filter = [ '.gitignore', '.travis.yml', '.git*' ] diff -Nru node-sntp-3.1.2/debian/upstream/metadata node-sntp-4.0.0/debian/upstream/metadata --- node-sntp-3.1.2/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ node-sntp-4.0.0/debian/upstream/metadata 2020-02-28 11:01:26.000000000 +0000 @@ -0,0 +1,7 @@ +--- +Archive: GitHub +Bug-Database: https://github.com/hueniverse/sntp/issues +Bug-Submit: https://github.com/hueniverse/sntp/issues/new +Changelog: https://github.com/hueniverse/sntp/tags +Repository: https://github.com/hueniverse/sntp.git +Repository-Browse: https://github.com/hueniverse/sntp diff -Nru node-sntp-3.1.2/lib/index.js node-sntp-4.0.0/lib/index.js --- node-sntp-3.1.2/lib/index.js 2019-08-15 01:06:10.000000000 +0000 +++ node-sntp-4.0.0/lib/index.js 2020-01-10 05:16:44.000000000 +0000 @@ -19,11 +19,11 @@ settings.port = settings.port || 123; settings.resolveReference = settings.resolveReference || false; - const team = new Teamwork(); + const team = new Teamwork.Team(); // Set timeout - const timeoutId = (settings.timeout ? setTimeout(() => team.attend(new Boom('Timeout')), settings.timeout) : null); + const timeoutId = settings.timeout ? setTimeout(() => team.attend(new Boom.Boom('Timeout')), settings.timeout) : null; // Create UDP socket @@ -39,13 +39,13 @@ const message = new internals.NtpMessage(buffer); if (!message.isValid) { - const error = new Boom('Invalid server response'); + const error = new Boom.Boom('Invalid server response'); error.time = message; return team.attend(error); } if (message.originateTimestamp !== sent) { - const error = new Boom('Wrong originate timestamp'); + const error = new Boom.Boom('Wrong originate timestamp'); error.time = message; return team.attend(error); } @@ -102,7 +102,7 @@ if (err || bytes !== 48) { - return team.attend(err || new Boom('Could not send entire message')); + return team.attend(err || new Boom.Boom('Could not send entire message')); } }); diff -Nru node-sntp-3.1.2/LICENSE.md node-sntp-4.0.0/LICENSE.md --- node-sntp-3.1.2/LICENSE.md 2019-08-15 01:06:10.000000000 +0000 +++ node-sntp-4.0.0/LICENSE.md 2020-01-10 05:16:44.000000000 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2012-2019, Sideway Inc, and project contributors +Copyright (c) 2012-2020, Sideway Inc, and project contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff -Nru node-sntp-3.1.2/.npmignore node-sntp-4.0.0/.npmignore --- node-sntp-3.1.2/.npmignore 2019-08-15 01:06:10.000000000 +0000 +++ node-sntp-4.0.0/.npmignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -* -!lib/** -!.npmignore diff -Nru node-sntp-3.1.2/package.json node-sntp-4.0.0/package.json --- node-sntp-3.1.2/package.json 2019-08-15 01:06:10.000000000 +0000 +++ node-sntp-4.0.0/package.json 2020-01-10 05:16:44.000000000 +0000 @@ -1,23 +1,26 @@ { "name": "@hapi/sntp", "description": "SNTP Client", - "version": "3.1.2", + "version": "4.0.0", "repository": "git://github.com/hapijs/sntp", "main": "lib/index.js", + "files": [ + "lib" + ], "keywords": [ "sntp", "ntp", "time" ], "dependencies": { - "@hapi/boom": "7.x.x", - "@hapi/bounce": "1.x.x", - "@hapi/hoek": "8.x.x", - "@hapi/teamwork": "3.x.x" + "@hapi/boom": "9.x.x", + "@hapi/bounce": "2.x.x", + "@hapi/hoek": "9.x.x", + "@hapi/teamwork": "4.x.x" }, "devDependencies": { - "@hapi/code": "6.x.x", - "@hapi/lab": "20.x.x" + "@hapi/code": "8.x.x", + "@hapi/lab": "22.x.x" }, "scripts": { "test": "lab -a @hapi/code -t 100 -L -m 20000", diff -Nru node-sntp-3.1.2/README.md node-sntp-4.0.0/README.md --- node-sntp-3.1.2/README.md 2019-08-15 01:06:10.000000000 +0000 +++ node-sntp-4.0.0/README.md 2020-01-10 05:16:44.000000000 +0000 @@ -1,77 +1,17 @@ - + -# sntp +# @hapi/sntp -An SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time -along with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset -to the local time. +#### SNTP client (REF4330) for node. -[![Build Status](https://secure.travis-ci.org/hapijs/sntp.svg?branch=master)](http://travis-ci.org/hapijs/sntp) +**sntp** is part of the **hapi** ecosystem and was designed to work seamlessly with the [hapi web framework](https://hapi.dev) and its other components (but works great on its own or with other frameworks). If you are using a different web framework and find this module useful, check out [hapi](https://hapi.dev) – they work even better together. -# Usage +### Visit the [hapi.dev](https://hapi.dev) Developer Portal for tutorials, documentation, and support -```javascript -const Sntp = require('@hapi/sntp'); +## Useful resources -// All options are optional - -const options = { - host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org - port: 123, // Defaults to 123 (NTP) - resolveReference: true, // Default to false (not resolving) - timeout: 1000 // Defaults to zero (no timeout) -}; - -// Request server time - -const exec = async function () { - - try { - const time = await Sntp.time(options); - console.log('Local clock is off by: ' + time.t + ' milliseconds'); - process.exit(0); - } - catch (err) { - console.log('Failed: ' + err.message); - process.exit(1); - } -}; - -exec(); -``` - -If an application needs to maintain continuous time synchronization, the module provides a stateful method for -querying the current offset only when the last one is too old (defaults to daily). - -```javascript -// Request offset once - -const exec = async function () { - - const offset1 = await Sntp.offset(); - console.log(offset1); // New (served fresh) - - // Request offset again - - const offset2 = await Sntp.offset(); - console.log(offset2); // Identical (served from cache) -}; - -exec(); -``` - -To set a background offset refresh, start the interval and use the provided now() method. If for any reason the -client fails to obtain an up-to-date offset, the current system clock is used. - -```javascript -const before = Sntp.now(); // System time without offset - -const exec = async function () { - - await Sntp.start(); - const now = Sntp.now(); // With offset - Sntp.stop(); -}; - -exec(); -``` +- [Documentation and API](https://hapi.dev/family/sntp/) +- [Versions status](https://hapi.dev/resources/status/#sntp) (builds, dependencies, node versions, licenses, eol) +- [Changelog](https://hapi.dev/family/sntp/changelog/) +- [Project policies](https://hapi.dev/policies/) +- [Free and commercial support options](https://hapi.dev/support/) diff -Nru node-sntp-3.1.2/test/index.js node-sntp-4.0.0/test/index.js --- node-sntp-3.1.2/test/index.js 2019-08-15 01:06:10.000000000 +0000 +++ node-sntp-4.0.0/test/index.js 2020-01-10 05:16:44.000000000 +0000 @@ -274,7 +274,7 @@ Sntp.stop(); - const team = new Teamwork(); + const team = new Teamwork.Team(); const onError = (err) => { expect(err).to.be.an.error(); diff -Nru node-sntp-3.1.2/.travis.yml node-sntp-4.0.0/.travis.yml --- node-sntp-3.1.2/.travis.yml 2019-08-15 01:06:10.000000000 +0000 +++ node-sntp-4.0.0/.travis.yml 2020-01-10 05:16:44.000000000 +0000 @@ -1,8 +1,6 @@ language: node_js node_js: - - "8" - - "10" - "12" - "node"