Catalog npm
PACKAGE EXPLORERView in registry

00h

npm

Format a number as a three-digit, zero-padded string (fixed-width codes).

codeformatpadthree-digitzero-pad
Versions collected1
Direct dependencies0From release 1.0.0
Last observed20 Oct, 16:34 UTC

README

Current package documentation

006

Format a number as a three-digit, zero-padded string — the shape used by many numeric codes (ISO-style IDs, ticket numbers, fixed-width export formats).

const code3 = require('006');

code3(6);      // '006'
code3('42');   // '042'
code3(12345);  // '12345'  (longer input returned as-is)

Zero dependencies. TypeScript types included.

API

code3(value)

ArgumentTypeDescription
valuenumber | stringValue to format. Non-numeric input is treated as 0; fractions are truncated; the sign is dropped.

Returns a string padded to at least 3 digits.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.0Registry latest11 Sept 20260

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:34 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:6e7ef5616653f4e3feb46dbfe96a71edc966b355a58190b08e35c9dd06f30381