0.0.6 • Published 7 years ago

porky v0.0.6

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

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

0.0.6

7 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago