unique-slug
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/unique-slug package

5.0.0 • Public • Published

unique-slug

Generate a unique character string suitible for use in files and URLs.

var uniqueSlug = require('unique-slug')

var randomSlug = uniqueSlug()
var fileSlug = uniqueSlug('/etc/passwd')

uniqueSlug(str) → String (8 chars)

If str is passed in then the return value will be its murmur hash in hex.

If str is not passed in, it will be 4 randomly generated bytes converted into 8 hexadecimal characters.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.0.0
5,248,884latest

Version History

VersionDownloads (Last 7 Days)Published
5.0.0
5,248,884
4.0.08,404,040
3.0.03,431,648
2.0.27,048,720
2.0.1178,284
2.0.0171,439
1.0.090

Package Sidebar

Install

npm i unique-slug

Weekly Downloads

24,483,105

Version

5.0.0

License

ISC

Unpacked Size

2.65 kB

Total Files

4

Last publish

Collaborators

  • gar
  • saquibkhan
  • npm-cli-ops
  • reggi
  • hashtagchris
  • owlstronaut