# make-it-restart

> restart script node javascript

Latest version **2.0.2** (published 2017-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install make-it-restart
pnpm add make-it-restart
yarn add make-it-restart
bun add make-it-restart
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2017-11-06 |
| First published | 2017-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | anuoua |
| Maintainers | anuoua |
| Keywords | restart, node |

## Links

- npm: https://www.npmjs.com/package/make-it-restart
- Repository: https://github.com/anuoua/make-it-restart
- Homepage: https://github.com/anuoua/make-it-restart#readme
- Issues: https://github.com/anuoua/make-it-restart/issues
- npm.io page: https://npm.io/package/make-it-restart

## Dependencies (2)

- [spawn-run](https://npm.io/package/spawn-run.md) 0.0.4
- [tree-kill](https://npm.io/package/tree-kill.md) ^1.1.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2017-11-06
- 2.0.1 — 2017-10-17
- 2.0.0 — 2017-10-17
- 1.1.3 — 2017-07-08
- 1.1.2 — 2017-05-17
- 1.1.1 — 2017-05-11
- 1.1.0 — 2017-05-10
- 1.0.1 — 2017-05-09

## README

# make-it-restart [![Build Status](https://travis-ci.org/anuoua/make-it-restart.svg?branch=master)](https://travis-ci.org/anuoua/make-it-restart)

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

## usage

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

create a restartor

```javascript
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
```javascript
let count = 0
console.log(process.env.NODE_ENV)
setInterval(() => {
    console.log(++count)
}, 500)
```

index.js
```javascript
const restart = require('make-it-restart')

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

restartor()

setInterval(() => {
    restartor()
}, 2000)
```
result
```bash
production
1
2
3
restarting...
production
1
2
3
restarting...
```

---
_Source: https://npm.io/package/make-it-restart · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
