Package Exports
- snowyflake
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (snowyflake) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Snowyflake - A modern implementation Snowflake on TypeScript
| 📖 Documentation |
|---|
Example usage
import { Snowlyflake, Epochs } from 'snowyflake';
const snowlyflake = new Snowlyflake({
workerId: 1n,
epoch: Epochs.TWITTER // BigInt timestamp
});
const snowflake = snowlyflake.nextId();
console.log(snowflake); // => 1075766315999952896n
const deconstructSnowflake = snowlyflake.deconstruct(snowflake);
console.log(deconstructSnowflake); // =>
// { timestamp: 1545317651163n,
// workerId: 1n,
// processId: 0n,
// sequence: 0n }