Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

correlation-id

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

correlation-id - npm Package Compare versions

Comparing version 4.0.0 to 5.0.0

index.d.ts

5

index.js
"use strict";
const { AsyncLocalStorage } = require("async_hooks");
const uuid = require("uuid");
const { randomUUID } = require("crypto");

@@ -26,4 +26,5 @@ const asyncLocalStorage = new AsyncLocalStorage();

work = id;
id = uuid.v4();
id = randomUUID();
}
if (!work) throw new Error("Missing work parameter");

@@ -30,0 +31,0 @@

36

package.json
{
"name": "correlation-id",
"version": "4.0.0",
"version": "5.0.0",
"description": "Correlation id for node.js",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.js",
"test",
"examples"
"index.d.ts"
],
"engines": {
"node": ">=12.17.0"
"node": ">=14.17.0"
},
"scripts": {
"lint": "prettier --write . && eslint .",
"lint": "prettier --check . && eslint .",
"fmt": "prettier --write .",
"test": "jest",
"coverage": "jest --coverage",
"coveralls": "coveralls < coverage/lcov.info"
"test:coverage": "jest --coverage"
},

@@ -36,12 +35,19 @@ "repository": {

"homepage": "https://github.com/toboid/correlation-id#readme",
"dependencies": {
"uuid": "^8.3.1"
"dependencies": {},
"devDependencies": {
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"jest": "^29.3.1",
"prettier": "^2.8.0"
},
"devDependencies": {
"coveralls": "^3.1.0",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"jest": "^26.6.3",
"prettier": "^2.1.2"
"jest": {
"coverageThreshold": {
"global": {
"branches": 100,
"functions": 100,
"lines": 100,
"statements": 100
}
}
}
}
# Correlation id
Correlation id maintains a consistent id across asynchronous calls in node.js applications.
This is extremely useful for logging purposes. For example within an API, each incoming request can be assigned an id that will be available in all function calls made processing that request, so we can see which requests caused errors.
Correlation id maintains a consistent id across asynchronous calls in node.js applications; this is especially useful for logging purposes.
For example within an API, each incoming request can be assigned an id that will be available in all function calls made processing that request, so we can see which requests caused errors.
100% test coverage, no prod dependencies.
## Installation
yarn:
```shell
yarn add correlation-id
```
npm:
```shell
npm i correlation-id --save

@@ -14,3 +25,3 @@ ```

From v4 onwards this library requires node >=12.17.0. For older node versions use v3.x.
From v5 onwards this library requires node >=14. For older node versions use v3.x or v4.x.

@@ -90,4 +101,8 @@ ## Simple example

## Typesript
Type defs are included.
## License
MIT
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc