@flowcore/time-bucket
v1.1.0
Published
A Time Bucket utility library for facilitating working with flowcore time buckets
Downloads
481
Readme
Time Bucket
A Time Bucket utility library for facilitating working with flowcore time buckets
Configured Time
To get a configured time bucket key for a given time, use the GetTimeBucketKey
function:
import { TimeBucket } from '@flowcore/time-bucket';
const pattern = "YYYYMMDDHHmmss";
const timeBucket = TimeBucket.create("YYYYMMDD", pattern);
const timeBucketKey = timeBucket(days()).format(pattern);
to get the configured time bucket increment for a given time pattern, use the GetTimeBucketKey
function:
import { TimeBucket } from '@flowcore/time-bucket';
const pattern = "YYYYMMDDHHmmss";
const timeBucketIncrement = TimeBucket.GetTimeBucketKey("YYYYMMDD", pattern).stripFrom;
Installation
install with npm:
npm install @flowcore/time-bucket
or yarn:
yarn add @flowcore/time-bucket
Usage
Development
yarn install
or with npm:
npm install