@openreply/emw-request-id
Advanced tools
Comparing version 2.0.1 to 2.0.3
@@ -10,3 +10,3 @@ /** | ||
// using random version of the uuid formats | ||
const uuidv4 = require('uuid/v4'); | ||
const { v4: uuidv4 } = require('uuid'); | ||
@@ -68,8 +68,9 @@ /** | ||
uuidGenerator | ||
} = Object.assign({ | ||
} = { | ||
traceHeader: 'X-Amzn-Trace-Id', | ||
requestIdHeader: 'x-amzn-RequestId', | ||
setResponseHeader: true, | ||
uuidGenerator: uuidv4 | ||
}, options); | ||
uuidGenerator: uuidv4, | ||
...options | ||
}; | ||
@@ -91,2 +92,2 @@ return (req, res, next) => { | ||
module.exports = requestId; | ||
module.exports = { requestId }; |
{ | ||
"name": "@openreply/emw-request-id", | ||
"version": "2.0.1", | ||
"description": "express middleware that manages request and trace ids", | ||
"keywords": [ | ||
"x-amzn-RequestId", | ||
"X-Amzn-Trace-Id", | ||
"express", | ||
"trace", | ||
"logging" | ||
], | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "nyc mocha test/*.js", | ||
"lint": "eslint --fix .", | ||
"doc": "jsdoc -P ./package.json -R ./README.md -d docs lib/*.js", | ||
"gitdoc": "jsdoc2md --plugin dmd-bitbucket --files lib/*.js > API.md", | ||
"clean": "rm -Rf docs API.md", | ||
"build": "npm run clean && npm run lint && npm run test && npm run doc && npm run gitdoc" | ||
}, | ||
"author": "“Florian <f.schaper@reply.de>", | ||
"license": "MIT", | ||
"repository": "bitbucket:openreply-de/emw-request-id", | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"dmd-bitbucket": "^0.1.10", | ||
"eslint": "^5.16.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-plugin-async-await": "0.0.0", | ||
"eslint-plugin-chai-friendly": "^0.4.1", | ||
"eslint-plugin-import": "^2.17.3", | ||
"eslint-plugin-mocha": "^5.3.0", | ||
"eslint-plugin-security": "^1.4.0", | ||
"express": "^4.17.1", | ||
"jsdoc": "^3.6.7", | ||
"jsdoc-to-markdown": "^5.0.0", | ||
"mocha": "^6.1.4", | ||
"nyc": "^14.1.1", | ||
"pre-commit": "^1.2.2", | ||
"sinon": "^7.3.2" | ||
}, | ||
"dependencies": { | ||
"uuid": "^3.3.2" | ||
} | ||
"name": "@openreply/emw-request-id", | ||
"version": "2.0.3", | ||
"description": "express middleware that manages request and trace ids", | ||
"keywords": [ | ||
"x-amzn-RequestId", | ||
"X-Amzn-Trace-Id", | ||
"express", | ||
"trace", | ||
"logging" | ||
], | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "nyc mocha test/*.js", | ||
"lint": "eslint --fix .", | ||
"doc": "jsdoc -P ./package.json -R ./README.md -d docs lib/*.js", | ||
"gitdoc": "jsdoc2md --plugin dmd-bitbucket --files lib/*.js > API.md", | ||
"clean": "rm -Rf docs API.md", | ||
"build": "npm run clean && npm run lint && npm run test && npm run doc && npm run gitdoc" | ||
}, | ||
"author": "“Florian <f.schaper@reply.de>", | ||
"license": "MIT", | ||
"repository": "bitbucket:openreply-de/emw-request-id", | ||
"devDependencies": { | ||
"chai": "^4.3.4", | ||
"dmd-bitbucket": "^0.1.10", | ||
"eslint": "^7.26.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-plugin-async-await": "0.0.0", | ||
"eslint-plugin-chai-friendly": "^0.7.1", | ||
"eslint-plugin-import": "^2.23.2", | ||
"eslint-plugin-mocha": "^8.1.0", | ||
"eslint-plugin-security": "^1.4.0", | ||
"express": "^4.17.1", | ||
"jsdoc": "^3.6.7", | ||
"jsdoc-to-markdown": "^7.0.1", | ||
"mocha": "^8.4.0", | ||
"nyc": "^15.1.0", | ||
"pre-commit": "^1.2.2", | ||
"sinon": "^10.0.0" | ||
}, | ||
"dependencies": { | ||
"uuid": "^8.3.2" | ||
} | ||
} |
@@ -7,2 +7,13 @@ # Request ID Express Middleware | ||
## Migration from 1.x to 2.x | ||
Use | ||
```javascript | ||
const { requestId } = require('@openreply/emw-request-id'); | ||
``` | ||
instead of | ||
```javascript | ||
const requestId = require('@openreply/emw-request-id'); | ||
``` | ||
for the import. | ||
## Getting Started | ||
@@ -42,3 +53,3 @@ | ||
/* eslint-enable import/no-extraneous-dependencies */ | ||
const requestId = require('@openreply/emw-request-id'); | ||
const { requestId } = require('@openreply/emw-request-id'); | ||
@@ -45,0 +56,0 @@ const app = express(); |
@@ -5,3 +5,3 @@ /* eslint-disable import/no-extraneous-dependencies, import/no-unresolved */ | ||
/* eslint-enable import/no-extraneous-dependencies, import/no-unresolved */ | ||
const requestId = require('..'); | ||
const { requestId } = require('..'); | ||
@@ -8,0 +8,0 @@ const app = express(); |
const { expect } = require('chai'); | ||
const sinon = require('sinon'); | ||
const requestId = require('..'); | ||
const { requestId } = require('..'); | ||
@@ -5,0 +5,0 @@ describe('emw-request-id', () => { |
Sorry, the diff of this file is not supported yet
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
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
1057109
841
111
+ Addeduuid@8.3.2(transitive)
- Removeduuid@3.4.0(transitive)
Updateduuid@^8.3.2