Gathering detailed insights and metrics for koa-static-resolver
Gathering detailed insights and metrics for koa-static-resolver
npm install koa-static-resolver
Typescript
Module System
Node Version
NPM Version
99.7
Supply Chain
99.5
Quality
76.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
3,582,388
Last Day
15,580
Last Week
82,523
Last Month
345,089
Last Year
2,910,657
MIT License
3 Stars
24 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Nov 26, 2024
Minified
Minified + Gzipped
Latest Version
1.0.6
Package Id
koa-static-resolver@1.0.6
Unpacked Size
15.20 kB
Size
4.38 kB
File Count
6
NPM Version
10.4.0
Node Version
20.11.1
Published on
Mar 18, 2024
Cumulative downloads
Total Downloads
Last Day
15.5%
15,580
Compared to previous day
Last Week
12.8%
82,523
Compared to previous week
Last Month
18.5%
345,089
Compared to previous month
Last Year
334%
2,910,657
Compared to previous year
5
Koa static file resolver, dirs, default index, path replace, cache, livereload, gzip
1npm install koa-static-resolver --save
1const Koa = require('koa'); 2const KSR = require('koa-static-resolver'); 3const app = new Koa(); 4app.use(KSR({ 5 dirs: ["./static/", "../node_modules/"], 6 defaultIndex: "index.html" 7})); 8app.listen(8080);
1app.use(KSR({ 2 dirs: ["./static/"], 3 //server cache (Memory) 4 cache: {}, 5 //do NOT cache big size file 6 cacheMaxLength: 10 * 1024 * 1024, 7 //browser cache header: max-age=<seconds> 8 maxAge: 600 9}));
1app.use(KSR({
2 dirs: ["./static/"],
3 livereload: '\n<script src="/livereload.js"></script>\n'
4}));
5//only inject to .html
1app.use(KSR({ 2 dirs: ["./static/"], 3 cache: {}, 4 gzip: true, 5 gzipMinLength: 1024, 6 gzipTypes: [".html", ".css", ".js", ".svg", ".xml"] 7})); 8//require headers with "Accept-Encoding": "gzip"
1app.use(KSR({ 2 dirs: ["./static/"], 3 include: ["include/folder", /RegExp/], 4 exclude: ["exclude/folder", /RegExp/] 5})); 6// any files not matched include/folder will be 404 not found 7// any files matched exclude/folder will be 404 not found 8// support RegExp
1app.use(KSR({ 2 dirs: ["./static/"], 3 replace: { 4 "from_path": "to_path" 5 } 6})); 7//when request /from_path/some_next_path/, will be replaced with /to_path/some_next_path/ to find out file path
1app.use(KSR({ 2 dirs: ["./static/"], 3 headers: { 4 "header_key": "header_value" 5 } 6}));
v1.0.5
v1.0.4
v1.0.3
v1.0.2
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/24 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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-02-24
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