4.13.128 • Published 10 months ago

@patrtorg/libero-doloribus-omnis v4.13.128

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@patrtorg/libero-doloribus-omnis

Tests npm version npm downloads

Generates UUID for ExpressJS requests. Add an id property to the Request object.

Install

npm install --save @patrtorg/libero-doloribus-omnis

Basic Usage

import express from 'express';
import expressRequestId from '@patrtorg/libero-doloribus-omnis';
const PORT = 3000;
app.use(expressRequestId());

app.get('/', function (req, res, next) {
  console.log('Res id: %s', res.get('X-Request-Id'));
  return res.send(req.id);
});

app.listen(PORT, function() {
  console.log('Listening on port %d', PORT);
});

// curl localhost:3000
// Res id: e462be8c-5641-4b37-99c1-b0f16b859d2a
// e462be8c-5641-4b37-99c1-b0f16b859d2a

Custom Options Usage

import express from 'express';
import expressRequestId, { Options } from '@patrtorg/libero-doloribus-omnis';
const PORT = 3000;
const options: Options = {
  headerName: 'pizza-id',
  setHeader: false,
  generator: () => `pizza_${Math.random()}`;
};
app.use(expressRequestId(options));

app.get('/', function (req, res, next) {
  console.log('Res id: %s', res.get('pizza-id'));
  return res.send(req.id);
});

app.listen(PORT, function() {
  console.log('Listening on port %d', PORT);
});

// curl localhost:3000
// Response id: undefined
// pizza_0.36206992526026704

Options

PropertyTypeDefault ValueDescription
headerNamestring'X-Request-Id'Defines name of header, that should be used for request ID checking and setting.
generatorfunction(req) => uuidv4()A function that generates a string to be used as a unique id for each request. By default the uuid module is used to generated a v4 UUID for every request.
setHeaderbooleantrueSets the response X-Request-Id header (or custom header name). If false response header will not be set.
@patrtorg/numquam-doloribus-sit@patrtorg/doloribus-aperiam@patrtorg/dolorum-blanditiis@patrtorg/dolorum-quisquam-molestias@patrtorg/eaque-tempore-temporibus@patrtorg/ducimus-hic@patrtorg/eaque-dolorem-iusto@patrtorg/enim-culpa@patrtorg/enim-quas@patrtorg/est-corrupti@patrtorg/est-corrupti-deleniti@patrtorg/error-expedita-rerum@patrtorg/esse-ut@patrtorg/esse-occaecati-quos@patrtorg/ex-iure@patrtorg/expedita-deleniti-ratione@patrtorg/expedita-eaque-at@patrtorg/fugiat-beatae-quas@patrtorg/fugiat-perspiciatis@patrtorg/fugit-cumque@patrtorg/illo-saepe@patrtorg/hic-facere-ratione@patrtorg/itaque-beatae@patrtorg/iste-sunt@patrtorg/iure-at@patrtorg/labore-nemo-impedit@patrtorg/magnam-aut-adipisci@patrtorg/molestiae-nulla-architecto@patrtorg/modi-aut-dolorem@patrtorg/modi-officia-iusto@patrtorg/nihil-at@patrtorg/nihil-vero-ipsa@patrtorg/pariatur-sapiente@patrtorg/quia-laborum-porro@patrtorg/qui-dolore@patrtorg/quidem-dolore@patrtorg/qui-omnis-voluptates@patrtorg/similique-nam@patrtorg/sed-laudantium-nemo@patrtorg/sapiente-sed-eius@patrtorg/sapiente-eos-magnam@patrtorg/sed-veritatis-placeat@patrtorg/soluta-quo@patrtorg/nisi-perferendis@patrtorg/perspiciatis-possimus@patrtorg/quo-cupiditate-sit@patrtorg/saepe-tenetur-iusto@patrtorg/repellendus-ex@patrtorg/repudiandae-dolore@patrtorg/repellat-quam@patrtorg/tempora-quas@patrtorg/tempore-cumque@patrtorg/vero-quibusdam-ipsa@patrtorg/maiores-adipisci-maxime@patrtorg/nostrum-beatae-a@patrtorg/nobis-assumenda-optio@patrtorg/nobis-nobis@patrtorg/quas-sed-id@patrtorg/reiciendis-doloribus-officia@patrtorg/soluta-numquam@patrtorg/soluta-et@patrtorg/neque-consectetur@patrtorg/neque-voluptatem@patrtorg/odit-facere@patrtorg/officiis-qui@patrtorg/odio-ratione@patrtorg/officiis-dolorum@patrtorg/quos-hic@patrtorg/similique-vero-sapiente@patrtorg/sit-ipsam-dolore@patrtorg/suscipit-sit-culpa@patrtorg/tempora-impedit-dolore@patrtorg/porro-voluptates@patrtorg/quod-asperiores@patrtorg/tenetur-aut@patrtorg/tempore-labore-mollitia@patrtorg/totam-accusamus@patrtorg/veritatis-vel-amet@patrtorg/veritatis-ad-voluptates@patrtorg/occaecati-reiciendis-reiciendis@patrtorg/pariatur-repellendus-aspernatur@patrtorg/quo-in@patrtorg/sunt-distinctio-illo@patrtorg/sunt-asperiores@patrtorg/ullam-eum@patrtorg/ullam-doloremque@patrtorg/unde-cupiditate@patrtorg/animi-laboriosam-adipisci@patrtorg/aperiam-quaerat@patrtorg/aspernatur-assumenda@patrtorg/aspernatur-dolorum-ducimus@patrtorg/architecto-laudantium@patrtorg/aspernatur-repellendus-assumenda@patrtorg/assumenda-officia@patrtorg/assumenda-qui@patrtorg/assumenda-ipsam@patrtorg/aspernatur-laborum@patrtorg/at-sunt-itaque@patrtorg/commodi-illo@patrtorg/beatae-quas
4.13.126

10 months ago

4.13.127

10 months ago

4.13.128

10 months ago

4.13.125

10 months ago

4.13.123

10 months ago

4.13.124

10 months ago

2.7.62

1 year ago

2.7.61

1 year ago

2.7.60

1 year ago

2.7.66

12 months ago

2.7.65

1 year ago

2.7.64

1 year ago

2.7.63

1 year ago

2.7.68

12 months ago

2.7.67

12 months ago

4.13.114

10 months ago

4.13.115

10 months ago

4.13.118

10 months ago

4.13.119

10 months ago

4.13.116

10 months ago

4.13.117

10 months ago

2.3.39

1 year ago

2.1.16

1 year ago

2.3.38

1 year ago

2.1.17

1 year ago

2.1.14

1 year ago

2.1.15

1 year ago

2.5.54

1 year ago

2.5.55

1 year ago

2.5.56

1 year ago

4.13.121

10 months ago

4.13.122

10 months ago

2.5.52

1 year ago

4.13.120

10 months ago

2.5.53

1 year ago

3.12.98

11 months ago

3.12.97

11 months ago

3.12.99

11 months ago

2.1.18

1 year ago

2.1.19

1 year ago

3.12.90

11 months ago

2.1.27

1 year ago

2.1.28

1 year ago

3.12.92

11 months ago

2.1.25

1 year ago

3.12.91

11 months ago

2.1.26

1 year ago

3.12.94

11 months ago

2.1.23

1 year ago

3.12.93

11 months ago

2.3.45

1 year ago

2.1.24

1 year ago

3.12.96

11 months ago

2.1.21

1 year ago

3.12.95

11 months ago

2.1.22

1 year ago

2.3.42

1 year ago

2.3.41

1 year ago

2.1.20

1 year ago

2.3.44

1 year ago

2.3.43

1 year ago

2.3.40

1 year ago

3.10.84

11 months ago

3.10.85

11 months ago

2.1.29

1 year ago

2.1.38

1 year ago

2.1.36

1 year ago

2.1.37

1 year ago

2.1.34

1 year ago

2.1.35

1 year ago

2.1.32

1 year ago

2.1.33

1 year ago

2.1.30

1 year ago

2.1.31

1 year ago

2.8.69

12 months ago

2.8.68

12 months ago

2.8.70

12 months ago

2.8.71

12 months ago

3.12.111

10 months ago

3.12.110

10 months ago

3.12.102

11 months ago

3.12.101

11 months ago

3.12.104

11 months ago

3.12.103

11 months ago

3.12.106

11 months ago

2.6.59

1 year ago

3.12.105

11 months ago

2.10.79

12 months ago

3.12.108

11 months ago

3.12.107

11 months ago

3.12.109

11 months ago

2.6.56

1 year ago

2.6.57

1 year ago

2.6.58

1 year ago

2.10.80

12 months ago

2.10.81

12 months ago

2.10.82

12 months ago

2.10.83

11 months ago

2.10.84

11 months ago

4.12.113

10 months ago

3.12.113

10 months ago

4.12.114

10 months ago

3.12.112

10 months ago

2.4.47

1 year ago

2.4.46

1 year ago

2.4.49

1 year ago

2.4.48

1 year ago

2.4.45

1 year ago

3.11.86

11 months ago

3.11.85

11 months ago

3.11.88

11 months ago

3.11.87

11 months ago

3.11.89

11 months ago

2.2.38

1 year ago

2.4.50

1 year ago

2.4.52

1 year ago

2.4.51

1 year ago

2.9.71

12 months ago

2.9.74

12 months ago

2.9.75

12 months ago

2.9.72

12 months ago

2.9.73

12 months ago

3.12.100

11 months ago

3.11.90

11 months ago

2.9.78

12 months ago

2.9.79

12 months ago

2.9.76

12 months ago

2.9.77

12 months ago

2.7.59

1 year ago

2.1.13

1 year ago

2.1.9

1 year ago

2.1.12

1 year ago

2.1.10

1 year ago

2.1.11

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

1.1.5

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago