@leapfrogtechnology/async-store
Advanced tools
Comparing version
# Changelog | ||
## [v2.0.0](https://github.com/leapfrogtechnology/async-store/tree/v2.0.0) (2022-01-20) | ||
[Full Changelog](https://github.com/leapfrogtechnology/async-store/compare/1.3.0-beta.0...v2.0.0) | ||
**Changes** | ||
- refactor\(impl/domain\): use native uuid generator [\#103](https://github.com/leapfrogtechnology/async-store/pull/103) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([DevAndromeda](https://github.com/DevAndromeda)) | ||
## [1.3.0-beta.0](https://github.com/leapfrogtechnology/async-store/tree/1.3.0-beta.0) (2022-01-14) | ||
@@ -11,2 +19,57 @@ | ||
**Changes** | ||
- Add Fastify example to initialize async store [\#99](https://github.com/leapfrogtechnology/async-store/pull/99) [[example](https://github.com/leapfrogtechnology/async-store/labels/example)] ([Prabeshpd](https://github.com/Prabeshpd)) | ||
- Add a plugin to initialize async store for fastify [\#98](https://github.com/leapfrogtechnology/async-store/pull/98) ([Prabeshpd](https://github.com/Prabeshpd)) | ||
- Bump path-parse from 1.0.6 to 1.0.7 in /examples/koa-http-server-ts [\#97](https://github.com/leapfrogtechnology/async-store/pull/97) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump path-parse from 1.0.6 to 1.0.7 in /examples/micro-http-server-ts [\#96](https://github.com/leapfrogtechnology/async-store/pull/96) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump path-parse from 1.0.6 to 1.0.7 in /examples/node-http-server-ts [\#95](https://github.com/leapfrogtechnology/async-store/pull/95) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump path-parse from 1.0.6 to 1.0.7 in /examples/express-http-server-ts [\#94](https://github.com/leapfrogtechnology/async-store/pull/94) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump path-parse from 1.0.6 to 1.0.7 [\#93](https://github.com/leapfrogtechnology/async-store/pull/93) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump glob-parent from 5.1.1 to 5.1.2 [\#92](https://github.com/leapfrogtechnology/async-store/pull/92) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump browserslist from 4.16.0 to 4.16.6 in /examples/koa-http-server-ts [\#91](https://github.com/leapfrogtechnology/async-store/pull/91) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump browserslist from 4.16.0 to 4.16.6 in /examples/micro-http-server-ts [\#90](https://github.com/leapfrogtechnology/async-store/pull/90) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump browserslist from 4.16.0 to 4.16.6 in /examples/node-http-server-ts [\#89](https://github.com/leapfrogtechnology/async-store/pull/89) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump browserslist from 4.16.0 to 4.16.6 in /examples/express-http-server-ts [\#88](https://github.com/leapfrogtechnology/async-store/pull/88) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.20 to 4.17.21 in /examples/koa-http-server-ts [\#87](https://github.com/leapfrogtechnology/async-store/pull/87) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.20 to 4.17.21 in /examples/micro-http-server-ts [\#86](https://github.com/leapfrogtechnology/async-store/pull/86) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.20 to 4.17.21 in /examples/express-http-server-ts [\#85](https://github.com/leapfrogtechnology/async-store/pull/85) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.20 to 4.17.21 in /examples/node-http-server-ts [\#84](https://github.com/leapfrogtechnology/async-store/pull/84) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.20 to 4.17.21 [\#83](https://github.com/leapfrogtechnology/async-store/pull/83) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump ssri from 6.0.1 to 6.0.2 in /examples/koa-http-server-ts [\#82](https://github.com/leapfrogtechnology/async-store/pull/82) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump ssri from 6.0.1 to 6.0.2 in /examples/micro-http-server-ts [\#81](https://github.com/leapfrogtechnology/async-store/pull/81) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump ssri from 6.0.1 to 6.0.2 in /examples/express-http-server-ts [\#80](https://github.com/leapfrogtechnology/async-store/pull/80) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump ssri from 6.0.1 to 6.0.2 in /examples/node-http-server-ts [\#79](https://github.com/leapfrogtechnology/async-store/pull/79) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump elliptic from 6.5.3 to 6.5.4 in /examples/koa-http-server-ts [\#78](https://github.com/leapfrogtechnology/async-store/pull/78) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump elliptic from 6.5.3 to 6.5.4 in /examples/micro-http-server-ts [\#77](https://github.com/leapfrogtechnology/async-store/pull/77) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump elliptic from 6.5.3 to 6.5.4 in /examples/express-http-server-ts [\#76](https://github.com/leapfrogtechnology/async-store/pull/76) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump elliptic from 6.5.3 to 6.5.4 in /examples/node-http-server-ts [\#75](https://github.com/leapfrogtechnology/async-store/pull/75) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Upgrade packages to latest version [\#74](https://github.com/leapfrogtechnology/async-store/pull/74) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([mesaugat](https://github.com/mesaugat)) | ||
- Bump dot-prop from 4.2.0 to 4.2.1 in /examples/node-http-server-ts [\#73](https://github.com/leapfrogtechnology/async-store/pull/73) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump dot-prop from 4.2.0 to 4.2.1 in /examples/express-http-server-ts [\#72](https://github.com/leapfrogtechnology/async-store/pull/72) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump dot-prop from 4.2.0 to 4.2.1 in /examples/micro-http-server-ts [\#71](https://github.com/leapfrogtechnology/async-store/pull/71) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump dot-prop from 4.2.0 to 4.2.1 in /examples/koa-http-server-ts [\#70](https://github.com/leapfrogtechnology/async-store/pull/70) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump ini from 1.3.5 to 1.3.8 in /examples/koa-http-server-ts [\#69](https://github.com/leapfrogtechnology/async-store/pull/69) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump ini from 1.3.5 to 1.3.8 in /examples/micro-http-server-ts [\#68](https://github.com/leapfrogtechnology/async-store/pull/68) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump ini from 1.3.5 to 1.3.8 in /examples/node-http-server-ts [\#67](https://github.com/leapfrogtechnology/async-store/pull/67) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump ini from 1.3.5 to 1.3.8 in /examples/express-http-server-ts [\#66](https://github.com/leapfrogtechnology/async-store/pull/66) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump node-fetch from 2.6.0 to 2.6.1 [\#65](https://github.com/leapfrogtechnology/async-store/pull/65) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump elliptic from 6.5.2 to 6.5.3 in /examples/koa-http-server-ts [\#64](https://github.com/leapfrogtechnology/async-store/pull/64) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump elliptic from 6.5.1 to 6.5.3 in /examples/micro-http-server-ts [\#63](https://github.com/leapfrogtechnology/async-store/pull/63) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump elliptic from 6.5.1 to 6.5.3 in /examples/node-http-server-ts [\#62](https://github.com/leapfrogtechnology/async-store/pull/62) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump elliptic from 6.5.1 to 6.5.3 in /examples/express-http-server-ts [\#61](https://github.com/leapfrogtechnology/async-store/pull/61) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump codecov from 3.6.5 to 3.7.1 [\#60](https://github.com/leapfrogtechnology/async-store/pull/60) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.15 to 4.17.19 in /examples/micro-http-server-ts [\#59](https://github.com/leapfrogtechnology/async-store/pull/59) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.15 to 4.17.19 in /examples/express-http-server-ts [\#58](https://github.com/leapfrogtechnology/async-store/pull/58) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.15 to 4.17.19 in /examples/koa-http-server-ts [\#57](https://github.com/leapfrogtechnology/async-store/pull/57) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.15 to 4.17.19 in /examples/node-http-server-ts [\#56](https://github.com/leapfrogtechnology/async-store/pull/56) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump lodash from 4.17.14 to 4.17.19 [\#55](https://github.com/leapfrogtechnology/async-store/pull/55) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump acorn from 6.3.0 to 6.4.1 in /examples/node-http-server-ts [\#54](https://github.com/leapfrogtechnology/async-store/pull/54) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump acorn from 6.4.0 to 6.4.1 in /examples/koa-http-server-ts [\#53](https://github.com/leapfrogtechnology/async-store/pull/53) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump acorn from 6.3.0 to 6.4.1 in /examples/express-http-server-ts [\#52](https://github.com/leapfrogtechnology/async-store/pull/52) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump acorn from 6.3.0 to 6.4.1 in /examples/micro-http-server-ts [\#51](https://github.com/leapfrogtechnology/async-store/pull/51) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump codecov from 3.6.1 to 3.6.5 [\#50](https://github.com/leapfrogtechnology/async-store/pull/50) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Bump handlebars from 4.2.0 to 4.5.3 [\#49](https://github.com/leapfrogtechnology/async-store/pull/49) [[dependencies](https://github.com/leapfrogtechnology/async-store/labels/dependencies)] ([dependabot[bot]](https://github.com/apps/dependabot)) | ||
- Convert Koa example based on JavaScript to TypeScript [\#48](https://github.com/leapfrogtechnology/async-store/pull/48) [[example](https://github.com/leapfrogtechnology/async-store/labels/example)] [[types](https://github.com/leapfrogtechnology/async-store/labels/types)] ([sarojrana](https://github.com/sarojrana)) | ||
## [1.2.0](https://github.com/leapfrogtechnology/async-store/tree/1.2.0) (2019-11-27) | ||
@@ -13,0 +76,0 @@ |
@@ -6,3 +6,3 @@ "use strict"; | ||
var domain = require("domain"); | ||
var uuid_1 = require("uuid"); | ||
var crypto_1 = require("crypto"); | ||
var ramda_1 = require("ramda"); // TODO: Import merge function only. | ||
@@ -27,3 +27,3 @@ var constants_1 = require("../constants"); | ||
d[StoreDomain_1.STORE_KEY] = {}; | ||
d[StoreDomain_1.ID_KEY] = uuid_1.v4(); | ||
d[StoreDomain_1.ID_KEY] = crypto_1.randomUUID(); | ||
d.run(callback); | ||
@@ -30,0 +30,0 @@ } |
{ | ||
"name": "@leapfrogtechnology/async-store", | ||
"version": "1.3.0-beta.0", | ||
"version": "2.0.0", | ||
"description": "Global store utility for an async operation lifecycle and chain of callbacks", | ||
@@ -60,4 +60,3 @@ "license": "MIT", | ||
"debug": "4.3.1", | ||
"ramda": "0.27.1", | ||
"uuid": "8.3.2" | ||
"ramda": "0.27.1" | ||
}, | ||
@@ -71,4 +70,4 @@ "devDependencies": { | ||
"@types/mocha": "^8.2.0", | ||
"@types/node": "^14.17.0", | ||
"@types/ramda": "^0.27.34", | ||
"@types/uuid": "^8.3.0", | ||
"chai": "^4.2.0", | ||
@@ -93,3 +92,6 @@ "chai-as-promised": "^7.1.1", | ||
"access": "public" | ||
}, | ||
"engines": { | ||
"node": ">= 14.17.0" | ||
} | ||
} |
# Async Store | ||
[](https://www.npmjs.com/package/@leapfrogtechnology/async-store) | ||
[](https://app.travis-ci.com/github/leapfrogtechnology/async-store) | ||
[](https://codecov.io/gh/leapfrogtechnology/async-store) | ||
@@ -25,2 +24,9 @@ [](https://github.com/leapfrogtechnology/async-store/blob/master/LICENSE) | ||
## Version Compatibility | ||
| Node Version | Async Store Version | | ||
| ----------------- | ------------------- | | ||
| 14.17.0 and above | >= 2.0.0 | | ||
| 14.17.0 and below | >= 1.0.0 < 2.0.0 | | ||
## Usage | ||
@@ -105,3 +111,3 @@ | ||
```js | ||
const uuid = require('uuid'); | ||
const { randomUUID } = require('crypto'); | ||
const express = require('express'); | ||
@@ -118,3 +124,3 @@ const store = require('@leapfrogtechnology/async-store'); | ||
app.use((req, res, next) => { | ||
store.set({ reqId: uuid.v4() }); | ||
store.set({ reqId: randomUUID() }); | ||
next(); | ||
@@ -146,3 +152,3 @@ }); | ||
```js | ||
const uuid = require('uuid'); | ||
const { randomUUID } = require('crypto'); | ||
const fastifyPlugin = require('fastify-plugin'); | ||
@@ -159,3 +165,3 @@ const store = require('@leapfrogtechnology/async-store'); | ||
fastifyInstance.addHook('preHandler', (req, reply, done) => { | ||
store.set({ reqId: uuid.v4() }); | ||
store.set({ reqId: randomUUID() }); | ||
done(); | ||
@@ -162,0 +168,0 @@ }); |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
71501
25.87%4
-20%1
-50%364
1.68%- Removed
- Removed