snowfall

2.1.0 • Public • Published

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));

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.0
    1
  • 2.0.0
    16
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i snowfall

Weekly Downloads

17

Version

2.1.0

License

MIT

Last publish

Collaborators

  • snek