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 🙏

© 2024 – Pkg Stats / Ryan Hefner

time-uid

v0.0.1

Published

shorter uid with configurable time and random components length

Downloads

2

Readme

time uid

Yet another unique id module, for use in distributed systems. Features and Requirements

  • all uids from a given user must be in lexicographical order
  • all uids from all concurrent users must be unique with a certain probability
  • ability to change the uid length for nested groups

This module is for cases where a lighter UID can be used in sub-groups (project files, thread messages)

Example id1/id2: /cIWr5hA4peMq6/h0ApXe3hZ

For comparison, below are example of available alternatives:

  • npm timer-uid, 20char, firebase, style
    • /-IWr5h0A4pe3h_mjpZq6/_IWr5h0A4pe3hMmjpZq6
  • npm cuid
    • /c-h72gsb32-0000-udoc-l363eofy/c-h72gsb32-0000-udoc-l363eofy
  • RFC-4122 style
    • /f81d4fae-7dec-11d0-a765-00a0c91e6bf6/f81d4fae-7dec-11d0-a765-00a0c91e6bf6

API

var TUID = require('tuid')
var tuid = TUID({users: 25, odds: 1e12, startDate: '2010-01-01'}),
    uid0 = tuid()

Options and Defaults

  • chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', character set
  • startDate = '2016-01-01', the beginning of time
  • tMin = 17, minimum time interval in ms (~= 1000/62)
  • tMax = 29 * SECONDS_PER_YEAR * 1000, maximum time in ms (29 years ~= 62^5)
  • length = 10 // default set at 4 char random
  • users = 20, minimum concurrent users making simultaneous edits
  • odds = 1e12 mininimum odds of a duplicate uid per second (1 in ...)

others modules on npm

  • (+) cuid, c-h72gsb32-0000-udoc-l363eofy, 29char
  • (+) puid, 4 sections and has 24 chars
  • (+) timer-uid, 20char, 8time + 12rnd, same as firebase
  • component-uid, random only
  • gen-uid
  • genuid, random only
  • j-uid
  • lite-id, random only
  • micro-uid
  • micro-uid, random base 62 uid
  • nid, random only
  • pure-uuid, RFC-4122
  • random-bytes, random only
  • random-id, random only
  • rndm, random only
  • scuid, ciuwr5ekh00044pe13ruhsmjpq6, 27char, random
  • short-uid, generates IDs of increasing length
  • short-uuid, ??
  • simple-random-id, random only
  • simple-uid, node-oly, 24-bytes of chaos, Base64
  • smart-id, random only
  • uid-safe, crypto
  • uid-util
  • uid, variable length, random only
  • uid2
  • uniqid, Unique Hexatridecimal ID generator (base16)
  • unique-id-generator, Date.now, prefix, numbers only (base10)
  • unique-id
  • unique
  • uuid-pure, ???
  • uuid-token-generator, ???