@danprince/serve

0.0.7 • Public • Published

Serve

Tiny live-reloading HTTP server. Alternative to live-server and browser-sync without all of the features/dependencies.

Reloads the page after any changes in the served directory, through a snippet of code injected into all served HTML files.

CLI Usage

# start a server in the current dir
serve

# start a server in a specific dir
serve ./dist

# run directly from npm
npx @danprince/serve ./dist

Programmatic Usage

import { createLiveReloadServer } from "@danprince/serve";

createLiveReloadServer({
  dir: "./dist",
  port: 8080,
});

See src/cli.ts for a more comprehensive example.

Readme

Keywords

none

Package Sidebar

Install

npm i @danprince/serve

Weekly Downloads

1

Version

0.0.7

License

Unlicense

Unpacked Size

9.75 kB

Total Files

9

Last publish

Collaborators

  • danprince