brisky-stamp

    4.0.1 • Public • Published

    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)

    Install

    npm i brisky-stamp

    DownloadsWeekly Downloads

    44

    Version

    4.0.1

    License

    ISC

    Last publish

    Collaborators

    • vigour-io