eventid is a JavaScript/TypeScript utility for generating unique event identifiers that are globally unique across a network of services and monotonically increasing locally on each machine. Currently at stable version 2.0.1, the library typically receives updates for Node.js compatibility and internal dependency management, with new major versions signifying breaking changes like increased minimum Node.js requirements. It provides a robust alternative to standard JavaScript timestamps, which often lack the necessary millisecond resolution for accurately ordering rapidly occurring events within distributed systems. Its core differentiation lies in producing lexicographically comparable IDs that maintain local monotonicity while guaranteeing global uniqueness, thereby facilitating event ordering across diverse services without relying on imprecise timestamp comparisons.
npm install eventidVerified import paths — ran on the pinned version, not inferred.
Demonstrates instantiation of EventId, generation of unique IDs, and verification of their local monotonic increase. It highlights how different instances ensure global uniqueness while individual instances maintain local order.
Upgrade your Node.js environment to version 10 or greater. For older Node.js environments, you must use a version of `eventid` prior to 2.0.0 (e.g., `npm install eventid@^1.0.0`).
Ensure your Node.js environment is at least version 8.x for `eventid` v1.x, or upgrade to Node.js 10+ for `eventid` v2.x.
Be aware that support and maintenance are community-driven and subject to the availability of contributors. Do not assume enterprise-level support or SLAs.
If `d64` is required by your application, install it as a direct dependency (`npm install d64`). Do not rely on transitive dependencies.
Use the correct default import syntax: `import EventId from 'eventid';` for ESM/TypeScript or `const EventId = require('eventid');` for CommonJS.In an ESM context, use `import EventId from 'eventid';`. If you must use `require`, ensure your project is configured for CommonJS or use a build tool to transpile.
Ensure `import EventId from 'eventid';` or `const EventId = require('eventid');` is present and correctly positioned in your module before `new EventId()` is called.