Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lassehaslev/executor
Watch for file changes and then execute command. Very nice for test driven development.
https://github.com/lassehaslev/executor
cli command command-line effect execute executor file-changes files hacktoberfest live-reload tdd test-driven-development utility watch
Last synced: 4 days ago
JSON representation
Watch for file changes and then execute command. Very nice for test driven development.
- Host: GitHub
- URL: https://github.com/lassehaslev/executor
- Owner: LasseHaslev
- Created: 2017-05-14T08:39:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-23T16:13:04.000Z (about 7 years ago)
- Last Synced: 2024-10-04T06:20:52.967Z (about 1 month ago)
- Topics: cli, command, command-line, effect, execute, executor, file-changes, files, hacktoberfest, live-reload, tdd, test-driven-development, utility, watch
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 17
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @lassehaslev/executor
> Run a command every time a file change. Its that simple.## Install
```bash
# Install project globaly
npm install -g @lassehaslev/executor# Install executor per project
npm install @lassehaslev/executor --save-dev
```## Usage
### Command line
```bash
# Doc
executor ""
[--run-on-first=true]
[--watch="**/*"]
[--ignore=""]-- [{Custom arguments added to the }]
# Example
executor './vendor/bin/phpunit --color=always' --watch='**/*.php' --ignore='/node_modules|\.git|vendor/'# Custom arguments
executor './vendor/bin/phpunit --color=always' --watch='**/*.php' -- --filter="CustomTest"
```### Npm
package.json
```json
{
"scripts": {
"my-script": "executor '' [options]",
}
}
```
Now you can run the command ```npm run my-script``` from command line.*If you run per project and not in a npm script the command is ```./node_modules/.bin/executor```.*
> Pro tip: use `npm run my-script -- --your --command-option="yey"` to add options to your command.
### Laravel TDD
I use this project to run Test Driven Development for my Laravel applications.Check out [this Laracasts thread](https://laracasts.com/discuss/channels/testing/laravel-mix-and-phpunit?page=1#reply-341786) for more information.
Add `tdd` script to projects package.json
```json
{
"scripts": {
"tdd": "executor './vendor/bin/phpunit --color=always' --watch='**/*.php' --ignore='node_modules/' --ignore='vendor/'"
}
}
```Then run `npm run tdd` from your projects folder.
> Pro tip: use `npm run tdd -- --filter="awesome_test"` to filter your phpunit tests.
## Contributing
Follow these steps to contribute to project.1. **Fork** the repo on GitHub
2. **Clone** the project to your own machine
3. **Commit** changes to your own branch
4. **Push** your work back up to your fork
5. Submit a **Pull request** so that we can review your changes## Development
```bash
# link to local command line
npm link# compile to es6
npm run dev# When you are finished unlink local command
npm unlink
```