6.10.104 • Published 10 months ago

@diotoborg/nemo-voluptatibus v6.10.104

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

logomakr_6nl700

All Contributors Build Status codecov npm GitHub license Maintenance

Motivation

This package was created to add a general way to handle exception for express application with the expectation to make it simpler to handle all possible requests.

Installation

add it to your project with npm install @diotoborg/nemo-voluptatibus or yarn add @diotoborg/nemo-voluptatibus

Use

there are 2 different ways to integrate the main functionality of this package, either by adding the handle that gets injected to the router framework

var exceptionHandler = require('@diotoborg/nemo-voluptatibus')
exceptionHandler.handle()
const app = require('express')()

or by wraping manually the routes

var wrap = require('@diotoborg/nemo-voluptatibus').wrap
router.post('/', wrap(async (req, res) => {
    ...
}))

it also integrates an extended class from Error that contains a message and a status that can be used to pass diferent information to the error handle

var httpError = require('@diotoborg/nemo-voluptatibus').exception
router.post('/', async (req, res) => {
    throw new HttpError('Great Message', 400, "{Response: awesome}")
}))

last but not least it also contains a middleware that can be added directly to express that handles the previous named errors.

var middleware = require('@diotoborg/nemo-voluptatibus').middleware
const app = require('express')()
app.use(middleware)

Options

The handle and the wrap function allow configuration parameters to be passed. The default is:

{
  nextOnce: true,
  defaultJsonResponse: false,
}
  • nextOnce: makes sure next can only be called once
  • defaultJsonResponse: runs res.json by default when the internally returned value is an object.

Logo

Arrows graphic by madebyoliver from Flaticon is licensed under CC BY 3.0. Check out the new logo that I created on LogoMaker.com https://logomakr.com/6nL7006nL700

Contributors

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Object.assignshimchineseeslintelasticachegetintrinsiccolorremoveglobalidletoolsramdatestingeffect-tsvalidateObjectprivatetstrimStartlibphonenumberxhrdataviewjoiapolloredux-toolkiti18nUnderscoreoptimistdomsqspreprocessornpmignoreasyncgraphqlflattenTypeScriptfullfind-uppatchObject.getPrototypeOfequalitysymbolstelephonearrayinstrumentationtranspileshellprotobufnodejsinvarianteslintpluginttyminimalselfspringWebSocketreact animationes-abstractdiffajaxponyfillcryptocloudtrailvariableses2017deepnpmmakecall-bindobjectreadablestreamjsargumentES2016validatorconcatgrouptoStringTagwhichdependenciesreusetape$.extendsymlinksrandominputcjklockfilekeyMicrosoftfpobjsesamazonforms_.extendjson-schemaformtacittypedarraysenderdebugcallhelperexpressrfc4122log[[Prototype]]package.jsoncloudformationformattingsharedarraybufferutilstoragegatewaybundlingtypedwalkingserializeec2transpilerclonewebindicatorworkspace:*ESloggingassertiondireslint-pluginrmargvStreamreducerexecutethreechannelmatchvalid3dES2018full-widthstreamsreworkunicodefiletypeofzxpicomatchxtermgroupBycachedeepcopydatecomputed-typesECMAScript 3TypeBoxqueueMicrotaskparentsECMAScript 2017rm -rfcontainsECMAScript 5helperschromiumzeroasciicoverageyupregular-expressionreversedtesttransformshamhas-ownjQuerywhatwggetiteratores-shimsutilityrdsterminalstringifierpyyamles2015varsdeepcloneObject.keysformatSystem.globaltypeerroragentclientStreamsrestawesomesaucepropertiescore-jssubprocesses2018validationlocationJSON-SchemadataViewsettingsnegativewidthArrayBufferprotoposedescriptorsajv@@toStringTagjsdompackagesgetPrototypeOfbusylook-upes-shim APIsyntaxclassesfastcopyfastclonesortimportlocalArray.prototype.flatMapaccessornamess3stringansislotespreees2016bufferanimationoutputchromepoint-freeuser-streamsObject.definePropertygdpruuidsetteroffsetrouterbinariesES2015toobjectUint16Arraypackage managerclassnamesmomentlookcolumnbuffersconsoleargsomitglobownenvironmentassertsfpsidinternaleverycoremake dirl10nartcall-boundES7Array.prototype.flattengitignoreHyBipushsameValueZerospinnerlengthwafregexcolumnslanguagesinatrajsonenvprivate datanamebeanstalkoncefeedfshasOwnPropertyebsArray.prototype.filterglacierglobalstddECMAScript 2023restfulescapecirculartoolkitappdeep-cloneflatMapFloat64ArrayArrayBuffer#slicehookssomeistanbulinferencecommandereventsdependency managerhasOwnconcatMapObject.isrm -frsyntaxerrorglobalThisschemetrimEndUint32ArrayES2019Int16ArraypostcssgetOwnPropertyDescriptorcompilerfunctionsString.prototype.matchAllURLreal-timeECMAScript 2022eventDispatcherbyteOffsetapihasmulti-packagecoercibletermpipecreatebinaryhardlinkses7rapidjapanesetyped arrayrssArray.prototype.includescolourreact posepretty0fast-deep-clonequerystringsetPrototypeOfECMAScripttouchvpcmergequeryutilsassertpropassignkoreanemitarraystoSortedpopmotionconsumetslibdragrequeststylestyleguideqsfunctionbytecallbackeast-asian-widthtakebabelsimpledbES2023visualredirectcollection.es6__proto__manipulationnumberSetconstpinoreactdropObject.valuestypesECMAScript 2016htmlwarningincurriedFunction.prototype.namerulesglobal this valuefnmatchstyled-componentsloadbalancingstarterglobal objectSymbol.toStringTagtesterAsyncIteratora11yInt8Arraypropertyrequireflagspecpruneio-tsmkdirquotemkdirptrimRightconfigurablecss-in-jsArrayBuffer.prototype.slicefindLastxmlCSS-0protocol-bufferscallboundmkdirscomparedataswftypesafeschemaacorncommand-lineECMAScript 7errorsuperstructsharedhttpsletperformanceES8isConcatSpreadablevarstringifyvestnodestructuredCloneclimatchAlltapsuperagentbindObject.entriesincludesinstallObject.fromEntrieschildlintstableastfast-copycloudfrontphoneprefixinstallerawsarraybufferwaitlrugenericsRegExp#flagswritablefindupmanagerpureautoscalingsymbolmrucheckReactiveExtensionselbRxJStransportString.prototype.trimtextexecfileslicespinnersfetchcloudsearchInt32Arrayreact-hook-formcloudwatchinternal slotenvironmentslinkregular expressionsbundlerpostcss-pluginperformantclassnamereact-hookses8toReversedpositiveupbyteLengthmobilermdirreducescheme-validationwindowBigInt64Array
6.10.104

10 months ago

6.10.103

10 months ago

6.10.102

10 months ago

6.10.101

10 months ago

5.10.101

10 months ago

5.10.100

10 months ago

5.10.99

10 months ago

5.10.98

10 months ago

5.10.97

10 months ago

5.10.96

10 months ago

5.10.95

10 months ago

5.10.94

10 months ago

5.10.93

10 months ago

5.10.92

10 months ago

5.10.91

10 months ago

5.10.90

10 months ago

5.10.89

10 months ago

5.10.88

11 months ago

5.9.88

11 months ago

5.9.87

11 months ago

5.9.86

11 months ago

5.9.85

11 months ago

5.9.84

11 months ago

5.9.83

11 months ago

5.9.82

11 months ago

5.9.81

11 months ago

5.9.80

11 months ago

5.9.79

11 months ago

5.9.78

11 months ago

5.9.77

11 months ago

5.9.76

11 months ago

5.9.75

11 months ago

5.9.74

11 months ago

5.9.73

11 months ago

5.9.72

11 months ago

5.9.71

11 months ago

5.9.70

11 months ago

5.9.69

11 months ago

5.9.68

11 months ago

5.9.67

11 months ago

4.9.67

11 months ago

4.9.66

11 months ago

4.9.65

11 months ago

4.9.64

11 months ago

4.8.64

11 months ago

4.8.63

11 months ago

4.8.62

11 months ago

3.8.62

12 months ago

3.8.61

12 months ago

3.8.60

12 months ago

3.8.59

12 months ago

3.8.58

12 months ago

3.8.57

12 months ago

3.8.56

12 months ago

3.8.55

12 months ago

3.8.54

12 months ago

3.8.53

12 months ago

3.8.52

12 months ago

3.8.51

12 months ago

3.8.50

12 months ago

3.8.49

12 months ago

3.8.48

12 months ago

3.8.47

12 months ago

3.8.46

12 months ago

3.7.46

12 months ago

3.7.45

12 months ago

3.7.44

12 months ago

3.7.43

1 year ago

3.7.42

1 year ago

3.7.41

1 year ago

3.7.40

1 year ago

3.7.39

1 year ago

2.7.39

1 year ago

2.6.39

1 year ago

2.6.38

1 year ago

2.6.37

1 year ago

2.6.36

1 year ago

2.6.35

1 year ago

2.6.34

1 year ago

2.5.34

1 year ago

2.5.33

1 year ago

2.5.32

1 year ago

2.4.32

1 year ago

2.4.31

1 year ago

2.4.30

1 year ago

1.4.30

1 year ago

1.4.29

1 year ago

1.4.28

1 year ago

1.4.27

1 year ago

1.4.26

1 year ago

1.4.25

1 year ago

1.4.24

1 year ago

1.3.24

1 year ago

1.3.23

1 year ago

1.2.23

1 year ago

1.2.22

1 year ago

1.2.21

1 year ago

1.2.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.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

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