SnowflakeJS is a Twitter snowflake generator and deconstructor for JavaScript.
$ yarn add @semperfortis/snowflakejs
import { generate } from '@semperfortis/snowflakejs';
// optional epoch, defaults to current date
const snowflake = generate({ epoch: 1577833200000 });
console.log(snowflake);
import { deconstruct } from '@semperfortis/snowflakejs';
// optional epoch, defaults to current date
const date = deconstruct(snowflake, { epoch: 1577833200000 });
console.log(date);