group dates into time buckets
This command and API modifies the dates given as input to the nearest bucket for the given time string. This way you can create "buckets" of time to lump events in.
$ echo -e '2015-11-24 3\n2015-11-12 4\n2015-11-22 5' \| tbucket week | sort2015-11-08 42015-11-22 32015-11-22 5
var tbucket = require('tbucket')var timestr = process.argv.slice(2).join(' ')process.stdin.pipe(tbucket(timestr)).pipe(process.stdout)
$ echo -e '2015-11-24 3\n2015-11-12 4\n2015-11-22 5' \| node lines.js week | sort2015-11-08 42015-11-22 32015-11-22 5
var tbucket =
Create a bucket transform stream from a recurring time string.
Some example values for a time string:
By default, the
stream expects lines of text as input with leading date
strings and produces lines of text as output.
true, produce objects as output
true, expect objects as input
true, produce objects as output and expect objects as input
In object mode (both read and write), the objects should have both
To install the library:
npm install tbucket
To install the command:
npm install tbucket -g