@m4rch/sv
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

@m4rch/sv

this is a package for file-serving with automatically added live-reload functionality

usage

cli

$ sv --help
  Description
    quickly serve and live-reload a folder for development.

  Usage
    $ sv [dir] [options]

  Options
    -p, --port        specify the port  (default 4000)
    -o, --open        open the website in a browser
    -s, --static      disable live-reloading and content updates
    -d, --list-dir    always list directories
    -v, --version     Displays current version
    -h, --help        Displays this message

  Examples
    $ sv dist
    $ sv -p 5000

api

you can import the serve function via

import serve from "@m4rch/sv"

the serve function takes an object as the only argument.

interface options {
	dir: string // the directory you want to serve
	port: number // the port of the wished service
	wsPort: number // the port of the live-reload socket
	static?: boolean // whether or not to live-reload,
	listDir?: boolean // whether or not to always list directories
}

credit

the ui is heavily inspired by the sirv-cli

Readme

Keywords

Package Sidebar

Install

npm i @m4rch/sv

Weekly Downloads

4

Version

0.1.7

License

Unlicense

Unpacked Size

24.4 kB

Total Files

32

Last publish

Collaborators

  • m4rch