nanoid
A tiny (108 bytes), secure URL-friendly unique string ID generator
Last updated 4 years ago by ai .
MIT · Repository · Bugs · Original npm
$ cnpm install nanoid 
SYNC missed versions from official npm registry.

Nano ID

Nano ID logo by Anton Lovchikov

English | Русский | 简体中文

A tiny, secure, URL-friendly, unique string ID generator for JavaScript.

“An amazing level of senseless perfectionism, which is simply impossible not to respect.”

  • Small. 108 bytes (minified and gzipped). No dependencies. Size Limit controls the size.
  • Fast. It is 2 times faster than UUID.
  • Safe. It uses hardware random generator. Can be used in clusters.
  • Short IDs. It uses a larger alphabet than UUID (A-Za-z0-9_-). So ID size was reduced from 36 to 21 symbols.
  • Portable. Nano ID was ported to 19 programming languages.
import { nanoid } from 'nanoid'
model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"

Supports modern browsers, IE with Babel, Node.js and React Native.

Sponsored by Evil Martians

Docs

Read full docs on GitHub.

Current Tags

  • 4.0.2                                ...           latest (2 years ago)

17 Versions

  • 4.0.2                                ...           2 years ago
  • 3.3.6                                ...           2 years ago
  • 3.3.3                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.3.4                                ...           3 years ago
  • 3.3.1                                ...           4 years ago
  • 3.2.0                                ...           4 years ago
  • 3.1.30                                ...           4 years ago
  • 3.1.29                                ...           4 years ago
  • 3.1.25                                ...           4 years ago
  • 3.1.23                                ...           4 years ago
  • 3.1.22                                ...           4 years ago
  • 3.1.20                                ...           5 years ago
  • 3.1.12                                ...           5 years ago
  • 1.3.4                                ...           7 years ago
  • 3.1.10                                ...           5 years ago
  • 2.1.11                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org