@pasmurno/serve
v0.0.6
Published
Vite based static server for local development
Downloads
250
Readme
@pasmurno/serve
simple static server for local development based Vite
Getting started
Install the @pasmurno/serve as global package:
npm install -g @pasmurno/serveor install local in project:
npm install --save-dev @pasmurno/serveCommands
Usage for global install:
$ serve [options]Usage for install in project:
$ npx serve [options]Use in package.json scripts:
"scripts": {
"serve": "serve [options]"
}and start this:
$ npm run serveOptions:
-v, --version output the current version
-p, --port <n> server port number (default: 3000)
-d, --dist [value] folder for serve files (default: dist)
-s, --host listen on all addresses, including LAN and public addresses
-h, --help display help for commandExample call:
$ serve -p 4200 -d build --host
...
$ npx serve --port 8000 --dist './static'API / Gulp You can programmatically start the local server if you import the server() function from the @pasmurno/serve package:
import { server } from "@pasmurno/serve";
async function browse() {
await server({
port: 8080, // server port number (default: 3000)
dist: "dist", // folder for serve files (default: dist)
host: true, // Set true to listen on all addresses, including LAN and public addresses (default: undefined)
});
}The best way to apply this can be found in the gulp project assignment.
License
MIT ©2025 pasmurno by llcawc. Made with ❤ to beautiful architecture
