1.0.0 • Published 1 year ago

serve-then v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

serve-then

NPM version

Inspired by start-server-and-test, but this isn't a cli tool. It will run a server in the child_process, and return the URL, then you can do what you want. When the current process ends, the child_process will also end.

features

  1. Based on and offering all features of live-server, But it has a few changes:
    • convert start/shutdown into Promise style.
    • reject if port is specified and already in use. (0 means random)
  2. Ships ESM and CJS bundles.
  3. Can get the server URL.
  4. Destroy child_process following the current process.

usage

import { serve, serveOptions } from 'serve-then'

serve(options as serveOptions).then(url => {
  // serving root at url
}).catch(err => {})

License

MIT License © 2023 KID-joker

1.0.0

1 year ago

1.0.0-rc.2

1 year ago

1.0.0-rc.1

1 year ago

1.0.0-rc.0

1 year ago