uuid-cron
Generate random uuids in a given time
Getting Started
1. Install
npm install uuid-cron
2. Init cron job
const { init, uuidv4CronLimited, stop } = require('uuid-cron');
init('each 20 seconds');
3. uuidv4Cron() will return random uuid every 20 seconds
const randomUUID = uuidv4Cron();
4. On finish, stop the cron job, otherwise it will continue infinitely
stop();
Limit the number of random uuids
use uuidv4CronLimited to control the number of uuids generated in each cron job
init('each 20 seconds', 30);
const limitedRandomUUIDS = uuidv4CronLimited();