Gathering detailed insights and metrics for lws
Gathering detailed insights and metrics for lws
Gathering detailed insights and metrics for lws
Gathering detailed insights and metrics for lws
A lean, modular web server for rapid full-stack development.
npm install lws
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95
Supply Chain
96.3
Quality
76.7
Maintenance
100
Vulnerability
99.3
License
JavaScript (100%)
Total Downloads
17,808,070
Last Day
5,015
Last Week
90,075
Last Month
397,914
Last Year
4,559,340
MIT License
48 Stars
327 Commits
18 Forks
3 Watchers
1 Branches
7 Contributors
Updated on Mar 29, 2025
Minified
Minified + Gzipped
Latest Version
4.2.0
Package Id
lws@4.2.0
Unpacked Size
48.56 kB
Size
17.89 kB
File Count
21
NPM Version
10.8.2
Node Version
22.7.0
Published on
Aug 29, 2024
Cumulative downloads
Total Downloads
Last Day
-0.9%
5,015
Compared to previous day
Last Week
-6.6%
90,075
Compared to previous week
Last Month
2.6%
397,914
Compared to previous month
Last Year
41.5%
4,559,340
Compared to previous year
A lean, modular web server for rapid full-stack development.
Lws is an application core for quickly launching a local web server. Behaviour is added via plugins giving you full control over how requests are processed and responses created.
Launch an HTTP server on the default port of 8000.
$ lws
Listening at http://mba4.local:8000, http://127.0.0.1:8000, http://192.168.0.200:8000
For HTTPS or HTTP2, pass the --https
or --http2
flags respectively.
$ lws --http2
Listening at https://mba4.local:8000, https://127.0.0.1:8000, https://192.168.0.200:8000
Now your server is running, the next step is to attach some middleware to process requests.
Install and use some middleware (lws-static and lws-index) to serve static files and directory listings.
$ npm install --save-dev lws-static lws-index
$ lws --stack lws-static lws-index
Listening at http://mba4.local:8000, http://127.0.0.1:8000, http://192.168.0.200:8000
The current directory will now be available to explore at http://127.0.0.1:8000
.
Install and use logging middleware. Note the lws-
prefix is optional when supplying module names to --stack
.
$ npm install --save-dev lws-log
$ lws --stack log static index --log.format combined
Listening at http://mba4.local:8000, http://127.0.0.1:8000, http://192.168.0.200:8000
::ffff:127.0.0.1 - GET /lws.config.js HTTP/1.1 200 52 - 8.259 ms
::ffff:127.0.0.1 - GET /package.json HTTP/1.1 200 399 - 1.478 ms
Lws uses Koa as its middleware engine. Here is a trivial plugin example, save the following code as example-middleware.js
:
1class ExamplePlugin { 2 middleware () { 3 return async (ctx, next) => { 4 ctx.body = 'Hello from lws!' 5 await next() 6 } 7 } 8} 9 10export default ExamplePlugin
Now launch an HTTP server using this middleware.
$ lws --stack example-middleware.js
Listening at http://mba4.local:8000, http://127.0.0.1:8000, http://192.168.0.200:8000
$ curl http://127.0.0.1:8000
Hello from lws!
$ npm install --save-dev lws
© 2016-24 Lloyd Brookes <75pound@gmail.com>.
Tested by test-runner. Documented by jsdoc-to-markdown.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
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