Installations
npm install vp-static-server
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
11.6.0
NPM Version
6.5.0-next.0
Score
67.2
Supply Chain
95.3
Quality
72.9
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (99.04%)
HTML (0.96%)
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Developer
victor-perez
Download Statistics
Total Downloads
18,989
Last Day
1
Last Week
3
Last Month
28
Last Year
242
GitHub Statistics
Apache-2.0 License
2 Stars
31 Commits
2 Branches
1 Contributors
Updated on Jan 28, 2023
Bundle Size
621.54 kB
Minified
244.74 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.4
Package Id
vp-static-server@1.0.4
Unpacked Size
39.26 kB
Size
11.30 kB
File Count
14
NPM Version
6.5.0-next.0
Node Version
11.6.0
Total Downloads
Cumulative downloads
Total Downloads
18,989
Last Day
0%
1
Compared to previous day
Last Week
200%
3
Compared to previous week
Last Month
7.7%
28
Compared to previous month
Last Year
-33.7%
242
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
vp-static-server
Simple static server using express static middle-ware
Getting Started
Install
Global
npm install vp-static-server -g
Project dependency
npm install vp-static-server --save
GIT
git clone https://github.com/victor-perez/vp-static-server.git
Usage
global
vp-static-server [options]
or
vpss [options]
node
node bin/server [options]
npm run
this works only by npm > 2
npm run server -- [options]
npm start
will always run node bin/server -c ./vp-static-server.json
npm start
scripting
1var server = require('vp-static-server'), 2 options = {}, 3 app = server(options); //returns Express application
Options
cli, node & npm run
-r --root Document root to use [./]
-a --host Address to use [0.0.0.0]
-p --port Port to use [0] ( auto select )
-o --open Open server URL in your default browser [true]
-s --https Create a ssl server ( HTTPS ) [false]
--https-cert CERT file for ssl server [ssl/127.0.0.1.cert]
--https-key KEY file for ssl server [ssl/127.0.0.1.key]
--static-* Express.static options:
--static-dotfiles [ignore]
--static-etag [true]
--static-index [index.html]
--static-lastmodified [true]
--static-maxage [0]
--static-redirect [true]
more info http://expressjs.com/4x/api.html#express.static
-c --config Path to the configuration file
-h --help Print this list and exit.
config.json
Name | Type | Default | Description |
---|---|---|---|
root | string | ./ | Document root to use |
host | string | 0.0.0.0 | Address to use |
port | number | 0 | Port to use 0 = auto select |
open | boolean | true | Open server URL in your default browser |
https | boolean|object | false | Create a ssl server ( HTTPS ), if true it will use ssl/127.0.0.1.(cert|key) |
https.cert | string | ssl/127.0.0.1.cert | CERT file for ssl server |
https.key | string | ssl/127.0.0.1.key | KEY file for ssl server |
static | object | {} | Express.static options [http://expressjs.com/4x/api.html#express.static] |
example
1{ 2 "root": "./", 3 "static": { 4 "dotfiles": "ignore", 5 "etag": true, 6 "index": "index.html", 7 "lastModified": true, 8 "maxAge": 0, 9 "redirect": true 10 }, 11 "host": "0.0.0.0", 12 "port": 3000, 13 "open": true, 14 "https": false 15}
scripting
Name | Type | Default | Description |
---|---|---|---|
root | string | ./ | Document root to use |
host | string | 0.0.0.0 | Address to use |
port | number | 0 | Port to use 0 = auto select |
open | boolean | true | Open server URL in your default browser |
https | boolean|object | false | Create a ssl server ( HTTPS ), if true it will use ssl/127.0.0.1.(cert|key) |
https.cert | string | ssl/127.0.0.1.cert | CERT file for ssl server |
https.key | string | ssl/127.0.0.1.key | KEY file for ssl server |
static | object | {} | Express.static options [http://expressjs.com/4x/api.html#express.static] |
example
1var server = require('vp-static-server'), 2 options = { 3 root: "./", 4 static: { 5 dotfiles: "ignore", 6 etag: true, 7 index: "index.html", 8 lastModified: true, 9 maxAge: 0, 10 redirect: true 11 }, 12 host: "0.0.0.0", 13 port: 3000, 14 open: true, 15 https: false 16 }, 17 app = server(options); //returns express application
example delay start
if you want to add middleware before the static middleware you can set autostart
to false
and call yourself vpStart()
to start the server
1var server = require('vp-static-server'), 2 options = { 3 root: "./", 4 static: { 5 dotfiles: "ignore", 6 etag: true, 7 index: "index.html", 8 lastModified: true, 9 maxAge: 0, 10 redirect: true 11 }, 12 host: "0.0.0.0", 13 port: 3000, 14 open: true, 15 https: false 16 }, 17 app = server(options, false); //returns express application 18 .use((req, res, next) = > { 19 console.log('log'); 20 next(); 21 }); 22 //start the server 23 app.vpStart();
Testing
npm test

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
Found 0/25 approved changesets -- score normalized to 0
Reason
project is archived
Details
- Warn: Repository is archived.
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 10 are checked with a SAST tool
Reason
15 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-h452-7996-h45h
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq
Score
1.7
/10
Last Scanned on 2025-02-17
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