</>PackageGraphPackageGraph

nanoid

npmv6.0.1TypeScript

A tiny (118 bytes), secure URL-friendly unique string ID generator

Safe to adopt

Yes — nanoid scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 37 days ago. 32 releases in the last 2 years.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • AMaintenance: grade A, Excellent.

    Last published 37 days ago. 32 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 14 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding nanoid to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

14 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
node ^22 || ^24 || >=26
Module format
ESM only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the nanoid README.

import { nanoid } from 'nanoid'
model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"

nanoid vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
nanoidthis page03MIT1 month ago
uuid254.8M8MIT1 day ago
tr46192.6M1MIT1 day ago
@jridgewell/resolve-uri166.3M1MIT1 day ago
punycode148.9M2MIT1 day ago
encodeurl133.6M5MIT1 day ago

Used by

Popular packages that depend on nanoid.

Relationship graph

Dependencies (left) and dependents (right) of nanoid.

postcssviteexpo-routernanoid
nanoid dependencies dependents

Frequently installed together

Release history

29 releases in the last two years, typically about 1 day apart.

Recent versions of nanoid
VersionPublishedSizeLicense
3.3.181 month ago25 KBMIT
6.0.1latest1 month ago14 KBMIT
3.3.171 month ago24 KBMIT
6.0.01 month ago14 KBMIT
3.3.161 month ago24 KBMIT
5.1.162 months ago13 KBMIT
3.3.152 months ago24 KBMIT
5.1.152 months ago13 KBMIT
3.3.142 months ago32 KBMIT
5.1.142 months ago13 KBMIT
5.1.132 months ago30 KBMIT
5.1.122 months ago30 KBMIT
3.3.132 months ago32 KBMIT
5.1.114 months ago13 KBMIT
3.3.124 months ago32 KBMIT

Overview

nanoid is an npm package that a tiny (118 bytes), secure URL-friendly unique string ID generator. It has 3 known dependents in the graph. The latest version is 6.0.1, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need a tiny (118 bytes), secure URL-friendly unique string ID generator and value a focused solution.

When not to use it

Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).
  • Zero runtime dependencies — minimal footprint.

Cons

  • No significant drawbacks detected from available metadata.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Funding

Frequently asked questions

Should I use nanoid?

Yes — nanoid scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 37 days ago. 32 releases in the last 2 years.

How do I install nanoid?

Run `npm install nanoid` to add nanoid to your npm project.

What license is nanoid released under?

nanoid is distributed under the MIT license.

How popular is nanoid?

npm does not publish download counts. Within PackageGraph's crawl, 3 known packages depend on nanoid.

Is nanoid still maintained?

The most recent release of nanoid (v6.0.1) was published 1 month ago.

Does nanoid run install scripts?

No. nanoid does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.