flakery

A tiny (~750 B) library for creating Twitter Snowflakes.

Usage no npm install needed!

<script type="module">
  import flakery from 'https://cdn.skypack.dev/flakery';
</script>

README

Flakery

version types bundle size license

A tiny (~750 B) library for creating Twitter Snowflakes.

Installation

npm install flakery

Usage

import { Client } from 'flakery'

const flakery = new Client()

// Example 1: Create a Snowflake.
const snowflake = flakery.next() // => '794278747242106880'

// Example 2: Extract the timestamp.
const timestamp = flakery.getTime(snowflake) // => 1609441210328