Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sntp

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sntp - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

6

lib/index.js

@@ -97,7 +97,3 @@ 'use strict';

const message = new Buffer(48);
for (let i = 0; i < 48; ++i) { // Zero message
message[i] = 0;
}
const message = Buffer.alloc(48); // Zero-filled message
message[0] = (0 << 6) + (4 << 3) + (3 << 0); // Set version number to 4 and Mode to 3 (client)

@@ -104,0 +100,0 @@ const sent = Date.now();

10

package.json
{
"name": "sntp",
"description": "SNTP Client",
"version": "3.0.1",
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)",
"version": "3.0.2",
"repository": {

@@ -16,9 +15,6 @@ "type": "git",

],
"engines": {
"node": ">=8.9.0"
},
"dependencies": {
"boom": "7.x.x",
"bounce": "1.x.x",
"hoek": "5.x.x",
"hoek": "6.x.x",
"teamwork": "3.x.x"

@@ -28,3 +24,3 @@ },

"code": "5.x.x",
"lab": "15.x.x"
"lab": "17.x.x"
},

@@ -31,0 +27,0 @@ "scripts": {

@@ -25,12 +25,16 @@ # sntp

Sntp.time(options, function (err, time) {
const exec = async function () {
if (err) {
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);
}
};
console.log('Local clock is off by: ' + time.t + ' milliseconds');
process.exit(0);
});
exec();
```

@@ -44,13 +48,14 @@

Sntp.offset(function (err, offset) {
const exec = async function () {
console.log(offset); // New (served fresh)
const offset1 = await Sntp.offset();
console.log(offset1); // New (served fresh)
// Request offset again
Sntp.offset(function (err, offset) {
const offset2 = await Sntp.offset();
console.log(offset2); // Identical (served from cache)
};
console.log(offset); // Identical (served from cache)
});
});
exec();
```

@@ -64,8 +69,10 @@

Sntp.start(function () {
const exec = async function () {
await Sntp.start();
var now = Sntp.now(); // With offset
Sntp.stop();
});
};
exec();
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc