New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

express-transaction-id

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-transaction-id

Express middleware to set a transaction id, unique identifier value that is attached to requests.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

express-transaction-id

npm workflow codecov GitHub npm

Express middleware to set a transaction id, unique identifier value that is attached to requests.

Installation

npm install express-transaction-id --save

Usage

In an express based application:


const  express = require('express');
const  transactionId = require('express-transaction-id');
  
const  app = express();

// Adding `express-transaction-id` middleware to generate transaction IDs
app.use(transactionId({ header: 'x-global-transaction-id' }));

app.get('/foo', (req, res, next) => {
   return res.status(200).json({ transaction_id: req.getId() });
});

Options

OptionTypeDefaultDescription
headerStringx-transaction-idThe name of the inbound header to check for a transaction id.

Methods

getId()

This methods is added to the incoming request by express-transaction-id, and will allow you to get transaction_id of current request.

req.getId(); // 1c204313-6526-4f36-b32f-a36a410c4ed8

License

MIT

Keywords

debug

FAQs

Package last updated on 24 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts