@kilann/guid-generator
v1.3.3
Published
A utility to generate sortable and unique Comb GUIDs
Downloads
31
Maintainers
Readme
GUID_generator
A utility to generate Comb GUIDs
Installation
npm install @kilann/guid-generator
yarn add @kilann/guid-generator
pnpm add @kilann/guid-generator
Why ?
This package is a simple utility to generate Comb GUIDs. A Comb GUID is a GUID that is generated from a timestamp and a UUID.
It make it sortable and unique.
You can pass in a prefix and/or suffix to the function, this will help you to identify the Comb GUID.
Fully without dependencies.
Usage
import { GUIDGenerator } from "@kilann/guid-generator";
const guid = GUIDGenerator();
// you can also pass in a prefix and/or suffix
const guid = GUIDGenerator("prefix", "suffix");
console.log(guid);
You can also create UUIDs with a prefix and/or suffix
import { UUIDGenerator } from "@kilann/guid-generator";
const uuid = UUIDGenerator();
const uuid = UUIDGenerator("prefix", "suffix");
console.log(uuid);
License
MIT