Skip to content

Generate prefixed, k-sorted globally unique identifiers... In node!

License

Notifications You must be signed in to change notification settings

cuvva/ksuid-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ksuid

Generate prefixed, k-sorted globally unique identifiers. You can read more about them in our blog post.

NPM Version Build Status Coverage Status

Installation

$ yarn add @cuvva/ksuid

Usage

const ksuid = require('@cuvva/ksuid');

const id = ksuid.generate('user').toString();
// user_000000BgNwexbyo1VZs78wVMGdBo3

try {
	const parsed = ksuid.parse('user_000000BgNwexbyo1VZs78wVMGdBo3');
} catch (error) {
	console.log('uh oh!');
}

Testing

Install the development dependencies first:

$ yarn

Then run the tests 👩‍🔬:

$ yarn test

Support

Please open an issue on this repository.

License

MIT licensed - see LICENSE file

About

Generate prefixed, k-sorted globally unique identifiers... In node!

Resources

License

Stars

Watchers

Forks

Packages

No packages published