🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@types/ntp-client

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/ntp-client

TypeScript definitions for ntp-client

ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
latest
Source
npmnpm
Version
0.5.0
Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/ntp-client

Summary

This package contains type definitions for ntp-client (https://github.com/moonpyk/node-ntp-client).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ntp-client.

index.d.ts

/** Default NTP port. Defaults to `123` */
export let defaultNtpPort: number;
/** Default NTP server. Defaults to `pool.ntp.org` */
export let defaultNtpServer: string;

/** The default timeout for NTP replies in milliseconds. Defaults to 10000 */
export let ntpReplyTimeout: number;

/**
 * Tries to retrieve the current time and date from an NTP server.
 * This function contacts the given NTP server on the given port and tries to
 * retrieve the current time and date. Upon success, the given callback
 * function is invoked and a date object is passed as second argument. If an
 * error occurs, the error is passed as first argument to the callback
 * function.
 * If either the param `server` or `port` are null or undefined, the default
 * NTP server or port, given by `defaultNtpServer` or `defaultNtpPort`
 * respectively, are used.
 *
 * @param server NTP to contact. If this value is null, the default NTP server is used
 * @param port Port to contact on NTP server. If this value is null, the default NTP port is used
 * @param callback Callback which is invoked on success or error. If the first param is not null, an
 * an error has occurred and the param contains the error. If it is null, the second param contains
 * the current time that was retrieved from the NTP server
 */
export function getNetworkTime(
    server: string | null | undefined,
    port: number | null | undefined,
    callback: (err: Error | string | null, date: Date | null) => void,
): void;

/**
 * Requests the current time from the default NTP server on the default port.
 *
 * This function is intended for demonstration purposes. It requests the
 * current time from the default NTP server using the default port and prints
 * it to the console. In case of an error, the error is also printed to the
 * console.
 *
 * @param argv Parameter vector. This value is ignored
 */
export function demo(...argv: any[]): void;

Additional Details

  • Last updated: Fri, 10 Nov 2023 18:36:08 GMT
  • Dependencies: none

Credits

These definitions were written by Thomas Röggla.

FAQs

Package last updated on 10 Nov 2023

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