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

ntp-client-promise

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ntp-client-promise

Query time from NTP servers with promises

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Net Time Protocol Client

Query time from NTP servers

Import

  • CommonJS
    const { getTime } = require("ntp-client-promise")
    
  • TypeScript
    import { getTime } from "ntp-client-promise"
    
  • ES Modules
    import ntp from "ntp-client-promise"
    const getTime = ntp.getTime;
    

Usage


const date = await getTime()
date // => 2022-09-02T19:21:33.186Z

const russianTime = await getTime({
  // Everything is optional
  
  server: "ntp5.stratum2.ru", 
  port: 123, // 123 is default NTP port
  timeout: 1000, // timeout in MS
  socketType: "udp6", // udp4 or udp6 - which IP type to use
  utc: false // sync with UTC time (default) or local
})

Keywords

FAQs

Package last updated on 02 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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