Koa middleware for serving static files with support for multiple directories, default index files, path replacement, caching, live reload injection, and on-the-fly gzip compression. Currently at v1.0.6, stable with TypeScript types included. Differentiators: built-in livereload script injection, flexible include/exclude patterns with RegExp support, path rewriting, and configurable gzip types — all in a single lightweight middleware.
npm install koa-static-resolverNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a Koa server with static file serving, caching, and gzip compression.
Sanitize livereload scripts or avoid using with untrusted HTML files.
Use `cache: {}` to enable in-memory cache, or omit to disable.Upgrade to v1.0.3 or later where the bug was fixed.
Use absolute paths or `path.resolve(__dirname, dirname)` to avoid ambiguity.
If you need fine-grained control over file serving, consider using `koa-send` directly or another middleware.
Cast configuration object to `any` if type errors occur: `KSR(options as any)`.
Use `import KSR from 'koa-static-resolver'` (no curly braces).
Use absolute paths: `dirs: [path.resolve(__dirname, 'static')]`.
Run `npm install koa-static-resolver`.
No dependency data recorded yet.