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 0.2.2 to 0.2.3

0

examples/offset.js

@@ -0,0 +0,0 @@ var Sntp = require('../lib');

@@ -0,0 +0,0 @@ var Sntp = require('../lib');

3

lib/index.js

@@ -42,2 +42,3 @@ // Load modules

isFinished = true;
socket.removeAllListeners();
socket.close();

@@ -52,3 +53,3 @@ return callback(err, result);

socket.on('error', function (err) {
socket.once('error', function (err) {

@@ -55,0 +56,0 @@ return finish(err);

{
"name": "sntp",
"description": "SNTP Client",
"version": "0.2.2",
"version": "0.2.3",
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "contributors": [],

@@ -67,4 +67,24 @@ // Load modules

it('times out on no response', function (done) {
it('errors on error event', function (done) {
var orig = Dgram.createSocket;
Dgram.createSocket = function (type) {
Dgram.createSocket = orig;
var socket = Dgram.createSocket(type);
process.nextTick(function () { socket.emit('error', new Error('Fake')) });
return socket;
};
Sntp.time(function (err, time) {
expect(err).to.exist;
expect(time).to.not.exist;
expect(err.message).to.equal('Fake');
done();
});
});
it('times out on invalid host', function (done) {
Sntp.time({ host: 'error', timeout: 10000 }, function (err, time) {

@@ -71,0 +91,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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