Gathering detailed insights and metrics for @masx200/koa-stream-etag
Gathering detailed insights and metrics for @masx200/koa-stream-etag
Gathering detailed insights and metrics for @masx200/koa-stream-etag
Gathering detailed insights and metrics for @masx200/koa-stream-etag
npm install @masx200/koa-stream-etag
Typescript
Module System
Node Version
NPM Version
68.9
Supply Chain
99.3
Quality
75.6
Maintenance
100
Vulnerability
100
License
JavaScript (81.66%)
TypeScript (18.34%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
4,667
Last Day
3
Last Week
12
Last Month
56
Last Year
1,187
2 Stars
153 Commits
1 Forks
1 Watching
7 Branches
14 Contributors
Minified
Minified + Gzipped
Latest Version
5.0.8
Package Id
@masx200/koa-stream-etag@5.0.8
Unpacked Size
10.44 kB
Size
4.00 kB
File Count
5
NPM Version
8.5.1
Node Version
16.15.1
Cumulative downloads
Total Downloads
Last day
50%
3
Compared to previous day
Last week
-25%
12
Compared to previous week
Last month
-31.7%
56
Compared to previous month
Last year
37.9%
1,187
Compared to previous year
forked from https://github.com/koajs/etag
If the response of the koa server is a stream without a path, the response header of etag can also be generated,The etag response header is generated by converting stream to buffer for etag calculation.
stream Etag support for Koa responses using etag.
1 2$ npm install @masx200/koa-stream-etag
$ yarn add @masx200/koa-stream-etag
1var etag = require("@masx200/koa-stream-etag");
etag([options])
Its return value is a koa middleware.
Generate a strong ETag for the given entity. This should be the complete body of the entity. Strings, Buffers, and fs.Stats are accepted. By default, a strong ETag is generated except for fs.Stats, which will generate a weak ETag (this can be overwritten by options.weak).
1var options = { weak: false, sizelimit: 1000 * 1024 }; 2app.use(etag(options));
etag accepts these properties in the options object.
weak
Specifies if the generated ETag will include the weak validator mark (that is, the leading W/). The actual entity tag is the same. The default value is false, unless the entity is fs.Stats, in which case it is true.
sizelimit
Its unit is byte.If the size of the stream is smaller than the'sizelimit', the etag response header will be generated,by converting stream to buffer for etag calculation.
1const conditional = require("koa-conditional-get"); 2const etag = require("@masx200/koa-stream-etag"); 3const Koa = require("koa"); 4const app = new Koa(); 5 6// etag works together with conditional-get 7app.use(conditional()); 8app.use(etag({})); 9 10app.use(function (ctx) { 11 ctx.body = "Hello World"; 12}); 13 14app.listen(3000, () => { 15 console.log("listening on port 3000"); 16});
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/24 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
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