dthree / dthree/vorpal

How to auto restart vorpal after any change to source code?

Open
#357 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.6k
Forks
278
PR merge metrics
No merged PRs in 30d

Description

I have an application:

```
$ node src/app.js

myapp~$ init --username fuads96 --password 12345678
App is ready.

myapp/@fuads96~$
```

The problem here is every time I change my source code, I have to **exit** current vorpal instance and restart it with the same command again.

How to restart automatically?

> perhaps I need something like `nodemon` for `node`.

### SOLUTION

I created a new [pull request](https://github.com/fuads96/vorpal/pull/1) to add a new option named `once` to the `vorpal.parse()` method to solve this problem.

Then we can use `nodemon` to watch destination source code and restart vorpal app with the `init` command:

```js
vorpal
.parse(process.argv, { once: true })
.show();
```

```
// package.json
...
scripts: {
"start": "nodemon --watch dist --exec \"init --username fuads96 --password 12345678\" "
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.