brisky-stamp

Generate unique meta information for change in a system, monotonic timestamps

Usage no npm install needed!

<script type="module">
  import briskyStamp from 'https://cdn.skypack.dev/brisky-stamp';
</script>

README

brisky-stamp

Generate unique meta information for change in a system, monotonic timestamps

Build Status js-standard-style npm version Coverage Status

const stamp = require('brisky-stamp')

// stamp.create(type, source, override)
// results in [ 946725040140, 0, 21158948 ]
// only lowercase letters from the alphabet are supported (base(36))

console.log(stamp.create('click'))

// fires when a stamp closes (is handled)
stamp.on(() => console.log('closing'))

// fires stamp listeners
stamp.close()

const parsed = stamp.parse(stamp)
// returns a parsed stamp { type: 'click', val: 1 }

// remove all listeners
stamp.clear()

// offset internal clock
stamp.offset = 100 // add 100 ms to timestamps

// check if listeners are in progress
stamp.inProgress // true or false

note Types only support base 36 characters - beware! (lowercase letters from the alphabet)