# cc-request-id

> Express.js request-id middleware.

Latest version **0.1.0** (published 2017-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install cc-request-id
pnpm add cc-request-id
yarn add cc-request-id
bun add cc-request-id
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-08-07 |
| First published | 2016-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | oleiba |
| Maintainers | oleiba |
| Keywords | request-id, correlation-id, colored-coins |

## Links

- npm: https://www.npmjs.com/package/cc-request-id
- Repository: https://github.com/Colored-Coins/request-id
- Homepage: https://github.com/Colored-Coins/request-id#readme
- Issues: https://github.com/Colored-Coins/request-id/issues
- npm.io page: https://npm.io/package/cc-request-id

## Dependencies (2)

- [uuid-1345](https://npm.io/package/uuid-1345.md) ^0.99.6
- [request-id](https://npm.io/package/request-id.md) ^0.11.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-08-07
- 0.0.4 — 2016-08-10
- 0.0.3 — 2016-08-03
- 0.0.2 — 2016-07-19
- 0.0.1 — 2016-07-18

## README

[![Build Status](https://travis-ci.org/Colored-Coins/request-id.svg?branch=master)](https://travis-ci.org/Colored-Coins/request-id)
[![Coverage Status](https://coveralls.io/repos/github/Colored-Coins/request-id/badge.svg?branch=master)](https://coveralls.io/github/Colored-Coins/request-id?branch=master)
[![npm version](https://badge.fury.io/js/cc-request-id.svg)](https://badge.fury.io/js/cc-request-id)
# request-id
Express.js request-id middleware.<br>
Allows you to identify client requests within non-sequential logs by adding a response header of `X-Request-Id`.
Allows setting value via query parameter or request header.

## Installation
```sh
$ npm install cc-request-id
```
## Running the tests
```
$ npm install
$ mocha
```
## API
```javascript
var requestId = require('cc-request-id')
```
### requestId(options)
Create new request-id middleware.
#### options
See [request-id options](https://github.com/wilmoore/request-id.js#options).
Exception:
Default value generator function: [uuid-1345.v4fast]

## Example
```javascript
var express = require('express')
var app = express()
var requestId = require('cc-request-id')
var bodyParser = require('body-parser')

app.use(requestId())
app.use(bodyParser())
app.get('/test', function (req, res, next) {
  res.send('OK')
})
app.listen(8080)
```
test it:
```
curl http://localhost:8080/test -I | grep X-Request-Id
```
outputs:
```
X-Request-Id: 98401c07-e91a-40ca-813e-5407970de407
```

## License

[MIT](license)

[uuid-1345.v4fast]:   https://github.com/scravy/uuid-1345#uuidv4fast

---
_Source: https://npm.io/package/cc-request-id · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
