Gathering detailed insights and metrics for shiny-express-formatter
Gathering detailed insights and metrics for shiny-express-formatter
npm install shiny-express-formatter
Typescript
Module System
Node Version
NPM Version
69.1
Supply Chain
87.8
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
16,005
Last Day
3
Last Week
8
Last Month
19
Last Year
142
12 Commits
1 Forks
3 Watching
1 Branches
3 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
shiny-express-formatter@1.0.0
Size
2.63 kB
NPM Version
5.5.1
Node Version
8.4.0
Cumulative downloads
Total Downloads
Last day
0%
3
Compared to previous day
Last week
-20%
8
Compared to previous week
Last month
90%
19
Compared to previous month
Last year
-42.3%
142
Compared to previous year
1
Formats requests and responses, and optionally bodies, for logging. When capturing response bodies, it only handles non-streaming requests. It is up to the app to determine what to do with the formatted objects
Example Request
{
"id": "7d575f6b-cac9-43cc-96f2-7695f909819d",
"headers": {
"host": "localhost:3080",
"connection": "keep-alive",
"accept": "application/json, text/plain, */*",
"user-agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36",
"referer": "http://localhost:3080/",
"accept-encoding": "gzip, deflate, sdch",
"accept-language": "en-US,en;q=0.8"
},
"method": "GET",
"path": "/api/widgets",
"body": {}
}
Example Response
{
"headers": {
"x-powered-by": "Express",
"content-length": "24",
"etag": "W/\"I4+1GQyv6zGcoXDQygDf+g==\""
},
"requestId": "7d575f6b-cac9-43cc-96f2-7695f909819d",
"time": 222,
"status": 200,
"size": 24,
"body": {
"widgets": [],
"links": []
}
}
Include the module
requestFormatter = require('shiny-express-formatter');
Add middleware for formatting requests/responses
app.use(requestFormatter.formatRequests(options));
Ensure any request body parsing middleware (e.g. body-parser) is set prior to using the formatting middleware
onRequestCaptured
: function(requestLogObject). callback to run once request object has been formatted. Useful for capturing request id to set bunyan child loggers. default: do nothing
onResponseCaptured
: function(requestLogObject, responseLogObject). callback to run once request and response objects have been formatted. default: do nothing
captureRequestBody
: boolean|function(req). whether to include the request body in the callback. default: false. If set to a function, returned results will be the boolean that determines whether to capture the body (allows logging only json bodies, for example)
captureResponseBody
: boolean|function(req, res). whether to include the response body in the callback. default: false. If set to a function, returned results will be the boolean that determines whether to capture the body (allows logging only json bodies, for example)
logRequestHeaders
: boolean|function(req). whether to include the request body in the callback. default: true. If set to a function, returned results will be used as headers to log (allows filtering out sensitive headers)
logResponseHeaders
: boolean|function(req, res). whether to include the response body in the callback. default: true. If set to a function, returned results will be used as headers to log (allows filtering out sensitive headers)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
no SAST tool detected
Details
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-27
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