Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
lite-webserver
Advanced tools
The npm package to create simple web server.
This will load files from /public
directory if it's not specified.
npm i lite-webserver
This server will load files from /public
directory.
var { WebServer } = require("lite-webserver")
var server = new WebServer()
server.start()
If you want to specify the directory to load a file, use the code below.
var { WebServer } = require("lite-webserver")
var server = new WebServer({
dir: "./public_html"
})
server.start()
Constructor
Type: Number
Default: 3000
new WebServer({
port: 3000
})
Type: String
Default: ./public
The directory to load the file.
new WebServer({
dir: "./public_html"
})
Type: String
(html code)
Default: 404 Not Found
new WebServer({
notfound: "File was not found on this server."
})
Function
Type: String
Type a filename to get http header content-type.
var { GetContentType } = require("lite-webserver")
var htmlname = "example.html"
var contenttype = GetContentType(htmlname)
console.log(contenttype) // "text/html"
var pngname = "image.png"
var contenttype = GetContentType(pngname)
console.log(contenttype) // "image/png"
© chasyumen 2021. Released under the MIT license
FAQs
creates simple web server.
The npm package lite-webserver receives a total of 0 weekly downloads. As such, lite-webserver popularity was classified as not popular.
We found that lite-webserver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.