4.9.84 • Published 10 months ago

@erboladaiorg/autem-doloremque v4.9.84

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

@erboladaiorg/autem-doloremque

Tests npm version npm downloads

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

Install

npm install --save @erboladaiorg/autem-doloremque

Basic Usage

import express from 'express';
import expressRequestId from '@erboladaiorg/autem-doloremque';
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 '@erboladaiorg/autem-doloremque';
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.
WeakMapstructuredCloneArray.prototype.flatMapTypeBoxes2017libphonenumberenvironmenttouchhasOwnhttpenvironmentsbufferarktypecss nestingspeedmergestatelessvisualJSONzxinstalleres8argsoperating-systemes6namessesairbnblanguagejson-schemadeepcopycollection.es6fast-deep-cloneserializationform-validationECMAScript 2020elmdragformatnpmignoreloggingfilterrobustjestmomentmockingomitgetPrototypeOfES3Object.entriesqsArray.prototype.filtershamponyfillexpressUint32ArrayArrayBuffer.prototype.sliceexecprotoStreamtypanionArray.prototype.flatutilityprefixmake dirsignedflagsECMAScript 2015ReactiveExtensionsstreamsdatastructurehandlerspropformsredacterror-handlingtypedarraybufferredux-toolkitObject.getPrototypeOfagenteslintconfigobjectES5fastES2015dom-testing-libraryminimalirqstoragegatewayebsdescriptorscorefullbabelfast-deep-copyenvjson-schema-validatorquerystringboundstylesheetexit-codepopmotionURLSearchParamsimportexportECMAScript 5concatinWeakSettextmapsomeswfsetPrototypeOfcjkglobal objectless.jsstringifygradients cssjapanesetoStringTagwalkfunction.lengthRFC-6455includestypesafechineseInt32Arraymoveyamlcontainsqueryvaluewriteparseutilsclassnamesbusyio-tssafedeepclonereplaybytefantasy-landshimarrayESString.prototype.matchAllcopyshebangarraysnodejsvalidatepostcss-pluginestreeless mixinssidetrimRightgetpredictablebinariesgenericsObjectexitglacierES2023callpackage managerdrophardlinksserializerquoteurlequalitycollectionmetadatalintAsyncIteratorjshintwgetSystem.globalreusetc39flattenxtermefficientkinesisautoprefixerbeanstalkinterruptstddFloat32Arraydirjsx.gitignorees2016assertsfastcopybrowserdeepajvbufferscloudformationtslibforEachsyntaxgroupBygradients css3deterministices-shimsregular expressiones-shim APIjwtpatchwhatwgjavascriptArrayBuffer#slicetestendpointroute53stringifiertostringtagbinvarsArray.prototype.findLastpicomatchUint8ClampedArrayfluxauthenticationmatchreal-timeserializeartreact-hook-formstatees-abstractprotobuftranspilerES2020performantselfweaksetgetoptstyleprettyECMAScript 6fullwidthweakmapqueuetimeECMAScript 2016authvalidationdirectorycss lesscolumnlinkamazonpositivefpsschemacloneeslintmatchAllreact-componentreadablesortloadingvpcfastifyFloat64Arraylazyfile systemthreeObservablemodulestoolslivepackagesinternal sloteventDispatcherposeformStyleSheetservercompile lesstypescriptReflect.getPrototypeOfframerlengthtrimLeftWebSocketsECMAScript 3iterationapitraverseSymbol.toStringTagreact-testing-librarybootstrap cssdynamodbcloudsearchmacosgdprbrowserslistfront-endhookformzeroStreamsflatMapcoercibleinternalexecfilelinuxchromefindLastdeletetermforkcloudtrailhelpersECMAScript 2023private datatoobjectArray.prototype.findLastIndexglobalpackage.jsonpostcssglobsnsnegative zeroajaxcsscolordatarulesesa11ybundlingtranspilekoreangettermoduletypeerrornumberescapejsonschemaespreeback-endcall-bindES6symlinkindicatortyped arrayasterisksTypeScripteventsJSON-SchemareadablestreamspinnerspinnersiteratoridentifierssyntaxerrormockpropertiestoSortedES7YAMLbrowserlistgraphqldeep-copyreducesuperstructrdsRxUint16Arraydeep-clonechaisymlinksservicefindLastIndexzodESnextCSSStyleDeclarationpinoclassnamewaapireadexpressionstylesstablevarURLcompiler_.extendasciiclassesworkersettingsfull-widthsigintInt16ArraygrouppurephonecurlObject.assigncodesintrinsicSymbolmonorepodotenvdommkdirsruntimeletconcatMapArrayendertesterES2022cryptpreprocessorjsbinaryecmascriptregexcallbacktacitpruneiamgesturesES2016pushpathnamerapidinspectkeypyyamlhashArray.prototype.includesisawesomesauceObject.isexecutes3matches.envnativeworkspace:*reducerdefineargumentTypedArrayreact posefromRxJSimmutableRegExp.prototype.flagshasOwnPropertyworkflowjsdiffignoreelectronbundlerasyncspawnautoscalingdataViewsameValueZerosubprocessclientcoloursequencehotObject.fromEntriesES2017removefixed-widthcallbounddataviewinstallsharedarraybufferECMAScript 2022dependenciesbyteLengthtakemanagerhasshellcompareconfigproxyrangeerrorieES2019trimEndschemeassertbcryptreact animationbannernested csspnpm9awsvestReactiveXbyteOffsetterminalerrorglobalsmkdiroffsetttyuninstallPromiseassertionmulti-packagespecHyBibabel-coreBigUint64Arrayprivatefindoutputopensslpasswordnodecrypto-0typeofstyled-componentseslintpluginsymbolresolveinputcreatediffPushmruslotfnmatchconsoleharmonyramdaargvjson-schema-validationObject.keysMicrosoftprogressdescriptiontoArraycommandermixinssetImmediateObject.definePropertyvariablesUint8ArrayisConcatSpreadableconfigurablepluginfunctionhandlertrimfsreact-hooksInt8Arrayperformanceflathigher-orderpolyfilldependency managerchromiumrouteECMAScript 2019enumerablepipetypesuploadcertificatesfunctionalvalidwritable256valuescomputed-typesregular-expressionSethas-ownbindlocalfpbootstrap lessvalidatortransportsigtermsymbolsemrES2018ansilrufast-copyparserECMAScript 2021requestoptionsetpromisees7processlistenersprotocol-buffersrgbiterate__proto__formattingMapclass-validatorArrayBuffermapreducesharedRegExp#flagsutilitiessignalssorteddefinePropertybddtypedarrayscss-in-jsgetOwnPropertyDescriptorhttpsapolloonceCSSelasticachees2018consume@@toStringTages5invariantconstextraoptimizerWebSocketUnderscoreeffect-tskeystypeObservablesFunction.prototype.nameslicemobilegetintrinsicxhrwindowcachecircularmkdirpfunctionstoolkithookscore-jsloggerlocationstylingcolorsECMAScript 7npmdescriptorpersistentcharacterjoiownjsdomcensoruser-streamsclicheckwafBigInt64Arrayfastcloneacorn[[Prototype]]jQuerydatetrimStartwhich6to5ES2021signaltestingECMAScript 2018scheme-validationcall-boundchildstatuscommand-lineanimationeslint-plugincallbindeventEmitternegativerecursiveloadbalancingviewregular0sqsqueueMicrotasktypedarrayec2inferenceimportlogwidthflagString.prototype.trimfast-clonespringreactl10nsuperagentcloudwatchdayjsvariables in cssredirectrandomaccessibilityoptimistjsonArray.prototype.containsencryptionhelperECMAScriptwarning$.extendstyleguideemitECMAScript 2017unicodecloudfrontobjutilglobalThisentrieselbeverystreamIteratortspropertynopeextendcommandi18nastaccessorlesscssstarteres2015gitignorefetchchannelwindowsregexputil.inspectless cssObject.valuesfigletyuppoint-freeequalglobal this valuerequirelastArray.prototype.flattenreduxrouting
4.9.84

10 months ago

4.9.83

10 months ago

4.9.82

10 months ago

4.9.81

11 months ago

4.9.80

11 months ago

4.8.80

11 months ago

4.8.79

11 months ago

4.8.78

11 months ago

4.7.78

11 months ago

4.7.77

11 months ago

4.7.76

11 months ago

4.7.75

11 months ago

4.7.74

11 months ago

4.7.73

11 months ago

4.7.72

11 months ago

4.7.71

11 months ago

4.7.70

11 months ago

4.7.69

11 months ago

4.7.68

11 months ago

4.7.67

11 months ago

3.7.67

11 months ago

3.7.66

11 months ago

3.6.66

11 months ago

3.6.65

11 months ago

3.6.64

11 months ago

3.5.64

11 months ago

3.4.64

11 months ago

3.4.63

11 months ago

3.4.62

11 months ago

3.4.61

11 months ago

3.4.60

11 months ago

3.4.59

11 months ago

3.4.58

11 months ago

3.3.58

12 months ago

3.3.57

12 months ago

3.3.56

12 months ago

3.3.55

12 months ago

3.3.54

12 months ago

3.3.53

12 months ago

3.3.52

12 months ago

3.3.51

12 months ago

3.3.50

12 months ago

3.3.49

12 months ago

3.3.48

12 months ago

3.3.47

12 months ago

3.3.46

12 months ago

3.3.45

12 months ago

3.3.44

12 months ago

3.3.43

12 months ago

3.3.42

12 months ago

3.3.41

12 months ago

3.2.41

12 months ago

3.2.40

12 months ago

3.2.39

1 year ago

3.2.38

1 year ago

3.2.37

1 year ago

3.2.36

1 year ago

3.2.35

1 year ago

3.2.34

1 year ago

3.2.33

1 year ago

3.2.32

1 year ago

3.2.31

1 year ago

3.2.30

1 year ago

3.2.29

1 year ago

3.2.28

1 year ago

3.2.27

1 year ago

3.2.26

1 year ago

3.1.26

1 year ago

3.1.25

1 year ago

3.1.24

1 year ago

3.1.23

1 year ago

2.1.23

1 year ago

2.1.22

1 year ago

2.1.21

1 year ago

2.1.20

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

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