UNPKG

uid-pool

Version:

High-performance UUID and unique ID pooling for Node.js. Pre-generate IDs in background worker threads for O(1) synchronous acquisition. Drop-in replacement for uuid.v4() and nanoid() with 10-100x better performance under load.

14 lines 1.1 kB
/** * uid-pool - High-performance ID pooling library * * Pre-generates IDs in background threads for O(1) synchronous acquisition. * Drop-in replacement for uuid.v4(), nanoid(), and other ID generators. */ // Re-export the auto-detection implementation by default export { IdPool } from "./auto/index.js"; // Export all error classes for type checking and error handling export { IdPoolError, InvalidConfigurationError, InvalidGeneratorError, InvalidPoolSizeError, InvalidMinSizeError, InvalidRefillBatchSizeError, InvalidCapacityError, PoolEmptyError, PoolNotReadyError, PoolStoppedError, PoolTimeoutError, GeneratorFailureError, InvalidGeneratorOutputError, WorkerNotInitializedError, WorkerTimeoutError, WorkerCrashError, WorkerGenerationError, SerializationError, ResourceExhaustionError, InvalidRuntimeError, } from "./core/errors.js"; // For explicit runtime selection, users can import directly: // import { IdPool } from "uid-pool/node" // Force Node.js implementation // import { IdPool } from "uid-pool/edge" // Force Edge runtime implementation //# sourceMappingURL=index.js.map