# lws-static

> Lws middleware wrapper for koa-static

Latest version **3.1.1** (published 2024-08-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install lws-static
pnpm add lws-static
yarn add lws-static
bun add lws-static
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.1 |
| Published | 2024-08-01 |
| First published | 2017-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12.17 |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Lloyd Brookes |
| Maintainers | 75lb |
| Keywords | lws, lws-middleware, static, server |

## Links

- npm: https://www.npmjs.com/package/lws-static
- Repository: https://github.com/lwsjs/static
- Homepage: https://github.com/lwsjs/static#readme
- Issues: https://github.com/lwsjs/static/issues
- npm.io page: https://npm.io/package/lws-static

## Dependencies (1)

- [koa-static](https://npm.io/package/koa-static.md) ^5.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 3.1.1 (latest) — 2024-08-01
- 3.1.0 — 2021-08-14
- 3.0.1 — 2021-07-06
- 3.0.0 — 2021-07-06
- 2.0.0 — 2020-02-09
- 1.1.3 — 2019-06-12
- 1.1.2 — 2019-06-09
- 1.1.1 — 2019-06-09
- 1.1.0 — 2019-06-03
- 1.0.0 — 2019-05-27
- 0.5.0 — 2018-04-11
- 0.4.1 — 2017-07-08
- 0.4.0 — 2017-07-07
- 0.3.4 — 2017-06-27
- 0.3.3 — 2017-06-26
- … 6 more at https://npm.io/package/lws-static/versions

## README

[![view on npm](https://badgen.net/npm/v/lws-static)](https://www.npmjs.org/package/lws-static)
[![npm module downloads](https://badgen.net/npm/dt/lws-static)](https://www.npmjs.org/package/lws-static)
[![Gihub repo dependents](https://badgen.net/github/dependents-repo/lwsjs/static)](https://github.com/lwsjs/static/network/dependents?dependent_type=REPOSITORY)
[![Gihub package dependents](https://badgen.net/github/dependents-pkg/lwsjs/static)](https://github.com/lwsjs/static/network/dependents?dependent_type=PACKAGE)
[![Node.js CI](https://github.com/lwsjs/static/actions/workflows/node.js.yml/badge.svg)](https://github.com/lwsjs/static/actions/workflows/node.js.yml)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)

# lws-static

Lws middleware plugin to serve static files, wraps [koa-static](https://github.com/koajs/static). See [here](https://github.com/lwsjs/local-web-server/wiki/How-to-serve-static-files) for usage instrutions.

Adds the following options to `lws`.

<pre><code>
--directory, -d <u>path</u>           Root directory, defaults to the current directory.
--static.maxage <u>number</u>         Cache max-age (in seconds) applied to all resources served.
--static.defer                 If true, serves after `await next`, allowing any downstream middleware to
                               respond first.
--static.index <u>path</u>            Default file name, defaults to `index.html`.
--static.extensions <u>ext</u>        One or more default filename extensions. For example, if you set
                               `--static.extensions html` and request `/page` then the server will look for
                               both `page` and `page.html` on disk, serving the latter.
</pre></code>

* * *

&copy; 2016-24 Lloyd Brookes \<75pound@gmail.com\>.

---
_Source: https://npm.io/package/lws-static · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
