Gathering detailed insights and metrics for static-server
Gathering detailed insights and metrics for static-server
npm install static-server
Typescript
Module System
Min. Node Version
Node Version
NPM Version
96.7
Supply Chain
91
Quality
75.3
Maintenance
84
Vulnerability
100
License
JavaScript (99.58%)
Shell (0.42%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
16,877,256
Last Day
6,384
Last Week
31,394
Last Month
134,879
Last Year
1,304,953
210 Stars
101 Commits
51 Forks
5 Watchers
1 Branches
17 Contributors
Updated on Feb 18, 2025
Minified
Minified + Gzipped
Latest Version
2.2.1
Package Id
static-server@2.2.1
Size
9.54 kB
NPM Version
5.5.1
Node Version
8.1.4
Published on
Apr 03, 2018
Cumulative downloads
Total Downloads
Last Day
16.8%
6,384
Compared to previous day
Last Week
6.9%
31,394
Compared to previous week
Last Month
32.6%
134,879
Compared to previous month
Last Year
-23.1%
1,304,953
Compared to previous year
A simple http server to serve static resource files from a local directory.
npm -g install static-server
static-server
-h, --help output usage information
-V, --version output the version number
-p, --port <n> the port to listen to for incoming HTTP connections
-i, --index <filename> the default index file if not specified
-f, --follow-symlink follow links, otherwise fail with file not found
-d, --debug enable to show error messages
-n, --not-found <filename> the error 404 file
-c, --cors <pattern> Cross Origin Pattern. Use "*" to allow all origins
-z, --no-nocache disable cache (http 304) responses.
-o, --open open server in the local browser
The server may be used as a dependency HTTP server.
1var StaticServer = require('static-server'); 2var server = new StaticServer({ 3 rootPath: '.', // required, the root of the server file tree 4 port: 1337, // required, the port to listen 5 name: 'my-http-server', // optional, will set "X-Powered-by" HTTP header 6 host: '10.0.0.100', // optional, defaults to any interface 7 cors: '*', // optional, defaults to undefined 8 followSymlink: true, // optional, defaults to a 404 error 9 templates: { 10 index: 'foo.html', // optional, defaults to 'index.html' 11 notFound: '404.html' // optional, defaults to undefined 12 } 13}); 14 15server.start(function () { 16 console.log('Server listening to', server.port); 17}); 18 19server.on('request', function (req, res) { 20 // req.path is the URL resource (file name) from server.rootPath 21 // req.elapsedTime returns a string of the request's elapsed time 22}); 23 24server.on('symbolicLink', function (link, file) { 25 // link is the source of the reference 26 // file is the link reference 27 console.log('File', link, 'is a link to', file); 28}); 29 30server.on('response', function (req, res, err, file, stat) { 31 // res.status is the response status sent to the client 32 // res.headers are the headers sent 33 // err is any error message thrown 34 // file the file being served (may be null) 35 // stat the stat of the file being served (is null if file is null) 36 37 // NOTE: the response has already been sent at this point 38});
An special thank you to all contributors who allow this project to continue to evolve.
Stable Version
1
7.5/10
Summary
static-server Path Traversal vulnerability
Affected Versions
<= 2.2.1
Reason
no binaries found in the repo
Reason
Found 8/20 approved changesets -- score normalized to 4
Reason
project is archived
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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
27 existing vulnerabilities detected
Details
Score
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