{"library":"ntp-client","title":"NTP Client for Node.js","description":"The `ntp-client` package provides a pure JavaScript implementation of the NTP (Network Time Protocol) client, allowing Node.js applications to retrieve the current network time from an NTP server. Its latest stable version, 0.5.3, was published over a decade ago in 2014, indicating that the project is largely abandoned. It differentiates itself by offering a minimal codebase with zero external dependencies, directly handling the NTP protocol for basic time retrieval. However, due to its lack of recent updates and maintenance, users might consider more actively maintained alternatives like `ntp-client-promise` or `ntp-time` for modern Node.js environments, especially those requiring ESM support or advanced features. An `@types/ntp-client` package exists, last updated in 2023, providing TypeScript definitions for version 0.5.0.","language":"javascript","status":"abandoned","last_verified":"Thu Apr 23","install":{"commands":["npm install ntp-client"],"cli":null},"imports":["const ntpClient = require('ntp-client');","const ntpClient = require('ntp-client');\nntpClient.getNetworkTime('pool.ntp.org', 123, ...);","ntpClient.getNetworkTime(server, port, callback);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const ntpClient = require('ntp-client');\n\nconst NTP_SERVER = process.env.NTP_SERVER ?? 'pool.ntp.org';\nconst NTP_PORT = parseInt(process.env.NTP_PORT ?? '123', 10);\n\nntpClient.getNetworkTime(NTP_SERVER, NTP_PORT, function(err, date) {\n    if (err) {\n        console.error('Failed to get network time:', err);\n        return;\n    }\n\n    console.log(`Current network time from ${NTP_SERVER}:${NTP_PORT}:`);\n    console.log(date.toISOString());\n    console.log('Local system time for comparison:');\n    console.log(new Date().toISOString());\n});","lang":"javascript","description":"Demonstrates how to fetch the current network time from a specified NTP server using the `getNetworkTime` function and log the result.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}