# lws-spa

> Middleware adding support for Single Page Applications to lws

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

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2024-08-01 |
| First published | 2017-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.17 |
| Dependencies | 1 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lloyd Brookes |
| Maintainers | 75lb |
| Keywords | lws, lws-middleware, spa |

## Links

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

## Dependencies (1)

- [koa-send](https://npm.io/package/koa-send.md) ^5.0.1

## 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

- 4.1.1 (latest) — 2024-08-01
- 4.1.0 — 2021-08-14
- 4.0.0 — 2021-07-06
- 3.0.0 — 2020-02-09
- 2.0.2 — 2019-07-01
- 2.0.1 — 2019-06-09
- 2.0.0 — 2019-06-03
- 1.0.1 — 2019-05-21
- 1.0.0 — 2019-05-21
- 0.3.0 — 2018-04-11
- 0.2.4 — 2017-07-11
- 0.2.3 — 2017-07-08
- 0.2.2 — 2017-07-01
- 0.2.1 — 2017-06-25
- 0.2.0 — 2017-06-18
- … 3 more at https://npm.io/package/lws-spa/versions

## README

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

# lws-spa

[lws](https://github.com/lwsjs/lws) middleware plugin adding support for Single Page Applications. For usage instructions, see [here](https://github.com/lwsjs/local-web-server/wiki/How-to-serve-a-Single-Page-Application-(SPA)).

Adds the following options to lws.

```
--spa, -s file                 Path to a Single Page App, e.g. app.html.
--spa.asset-test RegExp        A regular expression to identify an asset file. Defaults to ".", meaning the
                               server will only read from disk if the requested path contains a ".". This
                               option is more efficient than `spa.asset-test-fs`.
--spa.asset-test-fs            Use the filesystem to identify an asset file. If the file exists on disk,
                               serve it else return the SPA. If specified, `spa.asset-test` will be ignored.
                               This option is less efficient but more reliable than `spa.asset-test`.
```

* * *

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

Tested by [test-runner](https://github.com/test-runner-js/test-runner).

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