npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jscombguid

v1.1.3

Published

JavaScript module used to create comb guids.

Readme

JsCombGuid

npm version Build Status Coverage Status

A high-performance JavaScript Sequential GUID Generator that creates sortable, unique identifiers with microsecond precision. Perfect for databases, distributed systems, and any scenario where you need sortable, unique IDs.

Features

  • High Performance: Optimized for speed with minimal memory allocations
  • Microsecond Precision: Uses high-resolution timestamps for better uniqueness
  • Sortable: GUIDs are chronologically sortable by creation time
  • Collision Resistant: Multiple entropy sources and a counter for high-frequency generation
  • RFC4122 Compliant: Generates valid UUID v4 format
  • Zero Dependencies: Pure JavaScript with no external dependencies
  • TypeScript Support: Includes TypeScript type definitions

Installation

npm install jscombguid

Usage

ES Modules (Recommended)

import generateSequentialGuid from 'jscombguid';

// Generate a single GUID
const guid = generateSequentialGuid();
console.log(guid); // e.g., "550e8400-e29b-41d4-a716-446655440000"

// Generate multiple GUIDs
const guids = Array.from({ length: 10 }, () => generateSequentialGuid());

CommonJS

const generateSequentialGuid = require('jscombguid');

const guid = generateSequentialGuid();

TypeScript

import generateSequentialGuid from 'jscombguid';

const guid: string = generateSequentialGuid();

Use Cases

// Database primary keys
const userId = generateSequentialGuid();

// Sortable transaction IDs
const transactionIds = Array.from({ length: 100 }, () => generateSequentialGuid());
// These can be sorted chronologically!

// Distributed system identifiers
const sessionId = generateSequentialGuid();

Performance

The generator is optimized for high-performance scenarios:

  • Average generation time: < 0.1ms per GUID
  • Can generate 100,000+ unique GUIDs per second
  • Memory efficient with minimal allocations
  • Stable performance under load

How It Works

The generator creates sequential GUIDs by combining:

  1. A base UUID (24 characters)
  2. Days since 1900-01-01 (4 characters)
  3. Microseconds since start of day (8 characters)
  4. A 16-bit counter for high-frequency generation (4 characters)

This combination ensures:

  • Chronological sortability
  • High uniqueness
  • Microsecond precision
  • Collision resistance

API

generateSequentialGuid()

Generates a sequential GUID string.

Returns: string - A 36-character GUID in UUID v4 format

Example:

const guid = generateSequentialGuid();
// "550e8400-e29b-41d4-a716-446655440000"

Benchmarks

const iterations = 100000;
const start = process.hrtime();

for (let i = 0; i < iterations; i++) {
  generateSequentialGuid();
}

const [seconds, nanoseconds] = process.hrtime(start);
const averageTime = (seconds * 1000 + nanoseconds / 1000000) / iterations;
console.log(`Average generation time: ${averageTime.toFixed(3)}ms`);

Development

# Install dependencies
npm install

# Run tests
npm test

# Run linting
npm run lint

# Build
npm run build

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments