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

internet-time

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

internet-time - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

2

dist/index.js

@@ -1,1 +0,1 @@

const EventEmitter=require("events"),WebSocket=require("isomorphic-ws"),perf=require("./performance"),TimeClient=require("./client"),e=new EventEmitter;let s;const timeClient=new TimeClient({sendRequest:a=>{s.send(a)},createRequest:()=>perf.now()+perf.timeOrigin}),socket=()=>(s||(s=new WebSocket("wss://time-server.fly.dev/"),s.onclose=()=>{s=void 0,socket()},s.onmessage=({data:a})=>{const b=a.split(" "),c=timeClient.processResponse({tTx:+b[0],tServer:+(b[1]/1e3)});e.emit("delta",c)},s.onopen=()=>timeClient.start()),s);e.delta=()=>(socket(),timeClient.getDelta()||0),e.now=()=>perf.timeOrigin+perf.now()+e.delta(),e.nextDelta=()=>new Promise(a=>{e.now(),e.once("delta",a)}),module.exports=e;
const EventEmitter=require("events"),WebSocket=require("isomorphic-ws"),perf=require("./performance"),TimeClient=require("./client"),e=new EventEmitter;let s;const timeClient=new TimeClient({sendRequest:a=>{try{s.send(a)}catch(a){}},createRequest:()=>perf.now()+perf.timeOrigin}),socket=()=>(s||(s=new WebSocket("wss://time-server.fly.dev/"),s=new WebSocket("ws://localhost:8081/"),s.onclose=()=>{s=void 0,socket()},s.onmessage=({data:a})=>{const b=a.split(" "),c=timeClient.processResponse({tTx:+b[0],tServer:+(b[1]/1e3)});e.emit("delta",c)},s.onerror=()=>{},s.onopen=()=>timeClient.start()),s);e.delta=()=>(socket(),timeClient.getDelta()||0),e.now=()=>perf.timeOrigin+perf.now()+e.delta(),e.nextDelta=()=>new Promise(a=>{e.now(),e.once("delta",a)}),module.exports=e;
{
"name": "internet-time",
"version": "0.0.10",
"version": "0.0.11",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

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