2.0.2 • Published 7 years ago

make-it-restart v2.0.2

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

make-it-restart Build Status

Make command or app restart. e.g. make electron/webpack... restart.

usage

install

npm install make-it-restart --save-dev

create a restartor

const restart = require('make-it-restart')
let restartor = restart(command, env)

parameter

  • command: it supports running commands directly which in ./node_modules/.bin/, like npm run.
  • env: set environment variables with an object.

example

script.js

let count = 0
console.log(process.env.NODE_ENV)
setInterval(() => {
    console.log(++count)
}, 500)

index.js

const restart = require('make-it-restart')

let restartor = restart('node ./script.js', { NODE_ENV: 'production' })

restartor()

setInterval(() => {
    restartor()
}, 2000)

result

production
1
2
3
restarting...
production
1
2
3
restarting...
2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago