0.0.6 • Published 7 years ago
porky v0.0.6
Porky
A small utility to aid in testing client javascript development.
Installation
npm install porky --save-dev
Features
- serves directories with static content
- automatically reloads changed files
- automatically restarts if configuration is changed
- creates start page automatically
Usage
Porky comes with executables porky
and keepalive
. Best way to start porky
is using npm
, and specifically its configuration file package.json
.
{
...
"scripts": {
"start": "porky"
},
...
}
or
{
...
"scripts": {
"start:once": "porky",
"start": "keepalive npm run start:once"
},
...
}
Configuration
You can configure Porky in package.json
{
...
"config": {
"porky": {
"port": 8080,
"list": true,
"verbose": true,
"static": "./test,.",
"autoopen": true,
"embed": "lib/porky.js"
}
},
...
}
Configuration options
-r | --lrport # live-reload port
-p | --port # http port
-e | --embed x,y,... <script> tags automatically added to loaded page
-i | --index x Default file to open
-a | --autoopen Whether to automatically open in default browser
-l | --list Whether to list served files in automatic start page
-b | --beware x,y,... Chokidar file patterns whose modification restarts
-s | --static x,y,... Directories to be served
-v | --verbose Log more information
-h | --help You are staring at it
Another background process
You can also start another background process simultaneously by appending
--
and the desired command after that.
$ porky -ve bundle.js -- webpack -w
License
ISC