1.2.0 • Published 4 years ago

uuid-cron v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

uuid-cron

Generate random uuids in a given time

Getting Started

1. Install

npm install uuid-cron

2. Init cron job

import { init, getCronUUID, stop } from 'uuid-cron';
// for the first param, read cron syntax here: https://www.npmjs.com/package/human-to-cron
init('each 20 seconds');

3. getCronUUID() will return random uuid every 20 seconds

const randomUUID = getCronUUID();

4. On finish, stop the cron job, otherwise it will continue infinitely

stop();

Limit the number of random uuids

use getCronUUID to control the number of uuids generated in each cron job

init('each 20 seconds', 30);
// each 20 second generate 30 random uuids and return one of them each time
const limitedRandomUUIDS = getCronUUID();
1.2.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago