uuid-cron
Advanced tools
Comparing version 1.0.6 to 1.1.0
{ | ||
"name": "uuid-cron", | ||
"version": "1.0.6", | ||
"description": "", | ||
"main": "src/index.js", | ||
"version": "1.1.0", | ||
"description": "uuid-cron", | ||
"main": "index.js", | ||
"repository": { | ||
@@ -11,13 +11,18 @@ "type": "git", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"lint": "eslint . --ext .js", | ||
"lint-fix": "eslint . --ext .js --fix", | ||
"start": "./src/index.js" | ||
"start": "npm run build && npm run serve", | ||
"serve": "node dist/index.js", | ||
"clean": "rimraf coverage build tmp", | ||
"build": "tsc -p tsconfig.release.json", | ||
"build:watch": "tsc -w -p tsconfig.release.json", | ||
"lint": "eslint . --ext .ts,.tsx", | ||
"lint-fix": "eslint . --ext .ts,.tsx --fix", | ||
"test": "jest --coverage", | ||
"test:watch": "jest --watch" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"dependencies": { | ||
"cron": "1.8.2", | ||
"express": "^4.17.1", | ||
"express": "4.17.1", | ||
"human-to-cron": "0.3.1", | ||
@@ -27,6 +32,12 @@ "uuid": "8.3.2" | ||
"devDependencies": { | ||
"@types/jest": "^27.0.2", | ||
"@typescript-eslint/eslint-plugin": "^5.0.0", | ||
"eslint": "^8.0.1", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-plugin-import": "^2.25.2" | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-import": "^2.25.2", | ||
"eslint-plugin-jest": "^25.2.1", | ||
"jest": "^27.2.5", | ||
"ts-jest": "^27.0.7" | ||
} | ||
} |
# uuid-cron | ||
Generate random uuids in a given time | ||
# Quickstart | ||
# Getting Started | ||
@@ -13,13 +13,12 @@ **1. Install** | ||
const { init, uuidv4CronLimited, stop } = require('uuid-cron'); | ||
// run cron job every 20 seconds with 30 random uuids each time. | ||
// for the first param, read for more details: https://www.npmjs.com/package/human-to-cron | ||
init('each 20 seconds', 30); | ||
// for the first param, read cron syntax here: https://www.npmjs.com/package/human-to-cron | ||
init('each 20 seconds'); | ||
``` | ||
**3. Get random uuid according to the init params** | ||
**3. uuidv4Cron() will return random uuid every 20 seconds** | ||
```javascript | ||
const randomUUID = uuidv4CronLimited(); | ||
const randomUUID = uuidv4Cron(); | ||
``` | ||
**4. stop the cron job on finish** | ||
**4. On finish, stop the cron job, otherwise it will continue infinitely** | ||
```javascript | ||
@@ -29,1 +28,10 @@ stop(); | ||
### Limit the number of random uuids | ||
use uuidv4CronLimited to control the number of uuids generated in each cron job | ||
```javascript | ||
init('each 20 seconds', 30); | ||
// each 20 second generate 30 random uuids and return one of them each time | ||
const limitedRandomUUIDS = uuidv4CronLimited(); | ||
``` | ||
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
13930
16
214
1
36
9
1
+ Addedbody-parser@1.19.0(transitive)
+ Addedbytes@3.1.0(transitive)
+ Addedcontent-disposition@0.5.3(transitive)
+ Addedcookie@0.4.0(transitive)
+ Addeddepd@1.1.2(transitive)
+ Addeddestroy@1.0.4(transitive)
+ Addedexpress@4.17.1(transitive)
+ Addedfinalhandler@1.1.2(transitive)
+ Addedhttp-errors@1.7.2(transitive)
+ Addedinherits@2.0.3(transitive)
+ Addedms@2.1.1(transitive)
+ Addedon-finished@2.3.0(transitive)
+ Addedqs@6.7.0(transitive)
+ Addedraw-body@2.4.0(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsend@0.17.1(transitive)
+ Addedserve-static@1.14.1(transitive)
+ Addedsetprototypeof@1.1.1(transitive)
+ Addedstatuses@1.5.0(transitive)
+ Addedtoidentifier@1.0.0(transitive)
- Removedbody-parser@1.20.2(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcookie@0.6.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedexpress@4.19.2(transitive)
- Removedfinalhandler@1.2.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedms@2.1.3(transitive)
- Removedobject-inspect@1.13.1(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedqs@6.11.0(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsend@0.18.0(transitive)
- Removedserve-static@1.15.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstatuses@2.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
Updatedexpress@4.17.1