Skip to content

devsnek/node-snowfall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Snowfall

A Snowflake generator and deconstructor.

npm npm David

NPM

const Snowfall = require('snowfall');

const flurry = new Snowfall({
  epoch: Snowfall.EPOCHS.TWITTER,
  workerID: 7n,
  processID: 21n,
});

// generate a new snowflake
let flake = flurry.next();

// generate a snowflake with a custom date and interval
flake = flurry.next({
  timestamp: BigInt(new Date('2015-01-01').getTime()),
  internval: 10n,
});

console.log(flurry.deconstruct(flake));

About

A Snowflake generator and deconstructor.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published