Installations
npm install weboverlay
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>= 14
Node Version
18.17.0
NPM Version
9.6.7
Score
64.6
Supply Chain
63.2
Quality
72.9
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (94.55%)
JavaScript (4.8%)
HTML (0.47%)
CSS (0.18%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
kawanet
Download Statistics
Total Downloads
5,824
Last Day
2
Last Week
32
Last Month
150
Last Year
2,724
GitHub Statistics
1 Stars
131 Commits
2 Watching
13 Branches
1 Contributors
Bundle Size
1.14 MB
Minified
547.26 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.2
Package Id
weboverlay@1.0.2
Unpacked Size
24.48 kB
Size
7.08 kB
File Count
10
NPM Version
9.6.7
Node Version
18.17.0
Publised On
01 Aug 2023
Total Downloads
Cumulative downloads
Total Downloads
5,824
Last day
-75%
2
Compared to previous day
Last week
-17.9%
32
Compared to previous week
Last month
240.9%
150
Compared to previous month
Last year
189.5%
2,724
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
13
weboverlay
Layered Hybrid Web Server: local files, upstream proxy and content transform
SYNOPSIS
1# install 2npm install -g weboverlay 3 4# overlay multiple local document root paths 5weboverlay ../repo1/htdocs ../repo2/htdocs ../repo3/htdocs 6 7# overlay local files and upstream remote origin server contents with cache 8weboverlay htdocs https://example.com --cache 9 10# rewrite remote content with sed-style transform 11weboverlay 's#/example.com/#/127.0.0.1:3000/#g' https://example.com --cache=cached --log=dev --json 12 13# replace product names on a corporate website 14weboverlay "s/MacBook/Surface/g" https://www.apple.com --cache=cached --port=3000 15 16# mount git repository 17weboverlay ../repo1/.git:htdocs 18 19# mount raw Express middleware 20weboverlay "(req, res, next) => res.send('OK\n')" 21 22# open browser 23open http://127.0.0.1:3000/
CLI
1weboverlay [s/regexp/replacement/g] [type(function)] [htdocs...] [https://hostname] [--options...]
s/regexp/replacement/g
-sed
-style transforms applied for every text contentshtml(s=>s.toLowerCase())
- custom transform JavaScript function for the content typehtdocs
- path to local document root directory^/path/with/regexp\.(html|css|js)$=htdocs
- regexp to match with the path specified/path/to/not/found=404
- path to always respond the status:404 Not Found
path/to/.git:htdocs
- mounthtdocs
directory from.git
repository/alias/=local/path
- partial mount aliashttps://upstream.host
- URL to remote upstream origin server:http://
orhttps://
//virtual.host.name/=htdocs
- name based virtual host for local files//proxy.host.name/=https://upstream.host
- name based virtual host for upstream proxy//transorm.host.name/=s/regexp/replacement/g
- name based virtual host for content transform(req, res, next) => res.send('OK\n')
- raw Express middleware--basic=user:password
- username and password for basic authentication--cache=cached
- path to directory to cache remote content (default: disabled)--compress=br
- force compression with Brotli--compress=identity
- no compression--config=weboverlay.yml
- path to load configuration in YAML--index
- directory listing for local files (default: disabled)--json
- prettify JSON response (default: disabled)--log=dev
- morgan access log format:combined
,dev
, etc. (default:tiny
)--logfile=weboverlay.log
- path to write log (default: STDOUT)--port=3000
- port number to listen (default:3000
)
YAML
1# content source layers: local path, upstream proxy and content transform 2layers: 3 - s/regexp/replacement/g 4 - html(s => s.toLowerCase()) 5 - htdocs 6 - path/to/.git:htdocs 7 - ^/path/with/regexp\.(html|css|js)$ = htdocs 8 - /path/to/not/found = 404 9 - /alias/ = local/path 10 - https://upstream.host 11 - //virtual.host.name/ = htdocs 12 - //proxy.host.name/ = https://upstream.host 13 - //transorm.host.name/ = s/regexp/replacement/g 14 - (req, res, next) => res.send('OK\n') 15 16# username and password for basic authentication 17basic: 18 - user:password 19 20# path to directory to cache remote content (default: disabled) 21cache: cached 22 23# no compression 24compress: identity 25 26# directory listing for local files (default: disabled) 27index: true 28 29# prettify JSON response (default: disabled) 30json: true 31 32# morgan access log format: `combined`, `dev`, etc. (default: `tiny`) 33log: dev 34 35# path to write log (default: STDOUT) 36logfile: weboverlay.log 37 38# port number to listen (default: `3000`) 39port: 3000
API
See TypeScript declaration weboverlay.d.ts for more detail.
SEE ALSO
- https://github.com/kawanet/express-compress
- https://github.com/kawanet/express-intercept
- https://github.com/kawanet/express-sed
- https://github.com/kawanet/express-tee
- https://github.com/kawanet/express-upstream
- https://github.com/kawanet/serve-static-git
- https://github.com/kawanet/weboverlay
LICENSE
The MIT License (MIT)
Copyright (c) 2020-2023 Yusuke Kawasaki
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/kawanet/weboverlay/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/kawanet/weboverlay/nodejs.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:18
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
Found 0/11 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 23 are checked with a SAST tool
Score
3.4
/10
Last Scanned on 2025-02-03
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