Gathering detailed insights and metrics for koa-static-resolver
Gathering detailed insights and metrics for koa-static-resolver
Gathering detailed insights and metrics for koa-static-resolver
Gathering detailed insights and metrics for koa-static-resolver
Koa static file resolver, dirs, default index, path replace, cache, livereload, gzip
npm install koa-static-resolver
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
25 Commits
1 Watchers
1 Branches
1 Contributors
Updated on May 15, 2025
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
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
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
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/25 approved changesets -- score normalized to 0
Reason
no SAST tool detected
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
Score
Last Scanned on 2025-07-14
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