snoop-id
v1.0.1
Published
This library addresses the issue of generating unique and exclusive IDs based on a 10-digit timestamp
Downloads
11
Maintainers
Readme
SNOOP ID
Reading time: 1 Min
Description: This library addresses the issue of generating unique and exclusive IDs based on a 10-digit timestamp
INSTALL
Using npm:
npm install snoop-id
Example
import { SnoopID } from "snoop-id";
async function simulateManyRequest() {
const promise1 = SnoopID.generate();
const promise2 = SnoopID.generate();
const promise3 = SnoopID.generate();
const promise4 = SnoopID.generate();
const [r1, r2, r3, r4] = await Promise.all([promise1, promise2, promise3, promise4]);
console.log('Result 1:', r1);
console.log('Result 2:', r2);
console.log('Result 3:', r3);
console.log('Result 4:', r4);
}
simulateManyRequest();
Or
import {SnoopID} from "snoop-id";
const snoop = await SnoopID.generate().then(r => r)
console.log(snoop)
License
MIT