Gathering detailed insights and metrics for expressjs-response
Gathering detailed insights and metrics for expressjs-response
Gathering detailed insights and metrics for expressjs-response
Gathering detailed insights and metrics for expressjs-response
express-cache-response-directive
ExpressJS middleware that gives Response objects an intuitive .cacheControl method to set Cache-Control headers.
express-openapi-validator
Automatically validate API requests and responses with OpenAPI 3 and Express.
msgpack-response
ExpressJS msgpack response middleware
express-interceptor
A tiny interceptor for Express responses
npm install expressjs-response
Typescript
Module System
Node Version
NPM Version
70.7
Supply Chain
98.8
Quality
75
Maintenance
100
Vulnerability
100
License
TypeScript (80.04%)
JavaScript (19.96%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
24 Stars
85 Commits
9 Forks
3 Watchers
4 Branches
2 Contributors
Updated on Apr 04, 2025
Latest Version
1.0.4
Package Id
expressjs-response@1.0.4
Unpacked Size
92.59 kB
Size
27.13 kB
File Count
11
NPM Version
5.6.0
Node Version
9.7.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
Express middleware to generate JSON response
npm install expressjs-response --save
Use as Express middleware
1import express from 'express' 2import responseEnhancer from 'expressjs-response' 3 4const app = express() 5 6// use in express middleware 7app.use(responseEnhancer({ 8 withStatusCode: true, // Include status code in response body. 9 withStatusMessage: true, // Include status message in response body. 10})) 11 12// example usage 13app.get('/success', (req, res) => res.ok({ name: 'John Doe' })) 14app.get('/badrequest', (req, res) => res.badRequest('Invalid parameter.')) 15app.get('/badgateway', (req, res) => res.badGateway()) 16 17app.listen(3000, () => console.log('Start at http://localhost:3000'))
1res.ok({ name: 'John Doe' })
1HTTP/1.1 200 Ok 2{ 3 "status": "success", 4 "data": { 5 "name": "John Doe" 6 } 7}
1res.badRequest()
1HTTP/1.1 400 Bad Request 2{ 3 "status": "fail", 4 "error": { 5 "code": "400", 6 "message": "Bad Request" 7 } 8}
1res.badRequest('Invalid parameter.')
1HTTP/1.1 400 Bad Request 2{ 3 "status": "fail", 4 "error": { 5 "code": "400", 6 "message": "Bad Request", 7 "detail": "Invalid parameter." 8 } 9}
1res.badGateway()
1HTTP/1.1 502 Bad Gateway 2{ 3 "status": "error", 4 "error": { 5 "code": "502", 6 "message": "Bad Gateway" 7 } 8}
METHOD | CODE | PARAMS |
---|---|---|
res.ok() | 200 | res.ok(data) |
res.created() | 201 | res.created(data) |
res.noContent() | 204 | - |
res.badRequest() | 400 | res.badRequest(error) |
res.unauthorized() | 401 | res.unauthorized(error) |
res.forbidden() | 403 | res.forbidden(error) |
res.notFound() | 404 | res.notFound(error) |
res.methodNotAllowed() | 405 | res.methodNotAllowed(error) |
res.unprocessableEntity() | 422 | res.unprocessableEntity(error) |
res.internalServerError() | 500 | res.internalServerError(error) |
res.badGateway() | 502 | res.badGateway(error) |
res.serviceUnavailable() | 503 | res.serviceUnavailable(error) |
res.gatewayTimeout() | 504 | res.gatewayTimeout(error) |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
45 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More