Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
express-status
Advanced tools
Extends express response prototype with status codes helper methods.
The purpose of this library is to remove magic numbers from your code and define the status codes in one place.
npm install express-status
test with code coverage
gulp
unit test only
gulp test
Documentation is managed by commenting code with jsdoc and editing the template. You can regenerate the README.md by executing
gulp doc
<a name="module_express-status"></a>
Exports an object with status codes and extends the express request object by adding a method that will set the status code and return the request object.
Example
var statusCodes = require()
sets res status code to 101
Kind: static method of express-status
Example
function(req, res){
res.switchingProtocols().end();
}
sets res status code to 102
Kind: static method of express-status
Example
function(req, res){
res.processing().end();
}
sets res status code to 200
Kind: static method of express-status
Example
function(req, res){
res.ok().end();
}
sets res status code to 201
Kind: static method of express-status
Example
function(req, res){
res.created().end();
}
sets res status code to 202
Kind: static method of express-status
Example
function(req, res){
res.accepted().end();
}
sets res status code to 203
Kind: static method of express-status
Example
function(req, res){
res.nonAuthoritative().end();
}
sets res status code to 204
Kind: static method of express-status
Example
function(req, res){
res.noContent().end();
}
sets res status code to 205
Kind: static method of express-status
Example
function(req, res){
res.resetContent().end();
}
sets res status code to 206
Kind: static method of express-status
Example
function(req, res){
res.partialContent().end();
}
sets res status code to 207
Kind: static method of express-status
Example
function(req, res){
res.multiStatus().end();
}
sets res status code to 208
Kind: static method of express-status
Example
function(req, res){
res.alreadyReported().end();
}
sets res status code to 226
Kind: static method of express-status
Example
function(req, res){
res.imUsed().end();
}
sets res status code to 300
Kind: static method of express-status
Example
function(req, res){
res.multipleChoices().end();
}
sets res status code to 301
Kind: static method of express-status
Example
function(req, res){
res.movedPermanently().end();
}
sets res status code to 302
Kind: static method of express-status
Example
function(req, res){
res.found().end();
}
sets res status code to 303
Kind: static method of express-status
Example
function(req, res){
res.seeOther().end();
}
sets res status code to 304
Kind: static method of express-status
Example
function(req, res){
res.notModified().end();
}
sets res status code to 305
Kind: static method of express-status
Example
function(req, res){
res.useProxy().end();
}
sets res status code to 306
Kind: static method of express-status
Example
function(req, res){
res.switchProxy().end();
}
sets res status code to 307
Kind: static method of express-status
Example
function(req, res){
res.temporaryRedirect().end();
}
sets res status code to 308
Kind: static method of express-status
Example
function(req, res){
res.permanentRedirect().end();
}
sets res status code to 400
Kind: static method of express-status
Example
function(req, res){
res.badRequest().end();
}
sets res status code to 401
Kind: static method of express-status
Example
function(req, res){
res.unauthorized().end();
}
sets res status code to 403
Kind: static method of express-status
Example
function(req, res){
res.forbidden().end();
}
sets res status code to 404
Kind: static method of express-status
Example
function(req, res){
res.notFound().end();
}
sets res status code to 405
Kind: static method of express-status
Example
function(req, res){
res.methodNotAllowed().end();
}
sets res status code to 406
Kind: static method of express-status
Example
function(req, res){
res.notAcceptable().end();
}
sets res status code to 407
Kind: static method of express-status
Example
function(req, res){
res.proxyAuthenticationRequired().end();
}
sets res status code to 408
Kind: static method of express-status
Example
function(req, res){
res.requestTimeout().end();
}
sets res status code to 409
Kind: static method of express-status
Example
function(req, res){
res.conflict().end();
}
sets res status code to 410
Kind: static method of express-status
Example
function(req, res){
res.gone().end();
}
sets res status code to 411
Kind: static method of express-status
Example
function(req, res){
res.lengthRequired().end();
}
sets res status code to 412
Kind: static method of express-status
Example
function(req, res){
res.preconditionFailed().end();
}
sets res status code to 413
Kind: static method of express-status
Example
function(req, res){
res.requestEntityTooLarge().end();
}
sets res status code to 414
Kind: static method of express-status
Example
function(req, res){
res.requestUriTooLang().end();
}
sets res status code to 415
Kind: static method of express-status
Example
function(req, res){
res.unsupportedMediaType().end();
}
sets res status code to 416
Kind: static method of express-status
Example
function(req, res){
res.requestedRangeNotSatisfiable().end();
}
sets res status code to 417
Kind: static method of express-status
Example
function(req, res){
res.expectationFailed().end();
}
sets res status code to 418
Kind: static method of express-status
Example
function(req, res){
res.imATeapot().end();
}
sets res status code to 419
Kind: static method of express-status
Example
function(req, res){
res.authenticationTimeout().end();
}
sets res status code to 423
Kind: static method of express-status
Example
function(req, res){
res.locked().end();
}
sets res status code to 424
Kind: static method of express-status
Example
function(req, res){
res.failedDependency().end();
}
sets res status code to 426
Kind: static method of express-status
Example
function(req, res){
res.upgradeRequired().end();
}
sets res status code to 428
Kind: static method of express-status
Example
function(req, res){
res.preconditionRequired().end();
}
sets res status code to 429
Kind: static method of express-status
Example
function(req, res){
res.tooManyRequests().end();
}
sets res status code to 431
Kind: static method of express-status
Example
function(req, res){
res.requestHeaderFieldTooLarge().end();
}
sets res status code to 440
Kind: static method of express-status
Example
function(req, res){
res.loginTimeout().end();
}
sets res status code to 451
Kind: static method of express-status
Example
function(req, res){
res.unavailableForLegalReasons().end();
}
sets res status code to 500
Kind: static method of express-status
Example
function(req, res){
res.internalServerError().end();
}
sets res status code to 501
Kind: static method of express-status
Example
function(req, res){
res.notImplemented().end();
}
sets res status code to 502
Kind: static method of express-status
Example
function(req, res){
res.badGateway().end();
}
sets res status code to 503
Kind: static method of express-status
Example
function(req, res){
res.serviceUnavailable().end();
}
sets res status code to 504
Kind: static method of express-status
Example
function(req, res){
res.gatewayTimeout().end();
}
sets res status code to 505
Kind: static method of express-status
Example
function(req, res){
res.httpVersionNutSupported().end();
}
sets res status code to 506
Kind: static method of express-status
Example
function(req, res){
res.variantAlsoNegotiates().end();
}
sets res status code to 507
Kind: static method of express-status
Example
function(req, res){
res.insufficientStorage().end();
}
sets res status code to 508
Kind: static method of express-status
Example
function(req, res){
res.loopDetected().end();
}
sets res status code to 510
Kind: static method of express-status
Example
function(req, res){
res.notExtended().end();
}
sets res status code to 511
Kind: static method of express-status
Example
function(req, res){
res.notExtended().end();
}
FAQs
status code response helper
The npm package express-status receives a total of 84 weekly downloads. As such, express-status popularity was classified as not popular.
We found that express-status demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.