1.0.4 • Published 5 years ago
quick-dev v1.0.4
quick-dev
This tool accelerates your development process. It detects changes to your source files, rebuilds your project and reloads any browser currently viewing your page.
Installation
quick-dev
can be installed from the public npm registry.
For quick or temporary solutions, I recommend installing quick-dev
globally:
npm install -g quick-dev@latest
A more permanent solution is to make quick-dev
a development dependency of your package:
npm install --save-dev quick-dev@latest
Usage
Commandline Interface
Prefer using the node.js api instead.
Usage: qdev [options]
Short Option | Long Option | Description |
---|---|---|
-r [path] | --root [path] | files will be served from this directory |
-w [path] | --watch [path] | watch this path for changes |
-b [filename] | --build [filename] | run this script before reloading |
-a [address] | --addr [address] | address to bind to |
-v | --version | output the version number |
-h | --help | output usage information |
Node.js API
It's pretty basic, the following example should demonstrate all there is to know. For details refer to the source code.
const { DevServer } = require("quick-dev");
const dev = new DevServer({
root: "public/", // files will be served from this directory
port: 8080, // listen on this port
host: "127.0.0.1", // bind to this address
watch: [ "public/", "src/" ], // watch these directories for changes
build() {
// call this function before reloading the browsers
console.log("building sources ...");
}
});
dev.start();
Credits
This project was originally based upon tapio's live-server package. The code, however, has changed drastically since then.
License
This project is licenced under the MIT license.