1.0.4 • Published 6 years ago

js-runner v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

jsRunner

a server to excute js code

img codecov gif

install

// global
npm i js-runner -g
// local
npm i js-runner -g

feature

  • use webpack@4 to bundle code
  • read rules config and install dependencies automatically
  • hot reload

option

export interface Option {
    dir?: string
    // webpack plugin
    plugins?: any[],
    // webpack module
    rules?: any[],
    // webpack resolve
    resolve?: any,
    port?: number,
    // excutor function
    excutor?: string
    [propName: string]: any
}

example

code

import JsRunner from 'js-runner'

new JsRunner({
    port: '6666'
}).start()

cli usage

$ js-runner -h
Usage: js-runner [options]


  Options:

    -V, --version   output the version number
    -r, --root <n>  root directory, default: process.cwd()
    -p, --port <n>  listening port
    -c, --config    js.runner.config.js file
    -h, --help      output usage information
$ code ./folder
$ js-runner