lawnman
v0.2.1
Published
The one that maintains the development lawn
Readme
lawnman
Keeps the lawn clean
lawnman runs your npm scripts on changes.
Uses nodemon and npm-run-all.
Inspired by yardman.
Install
npm i lawnman -DThen use lawnman in your package.json scripts:
{
"scripts": {
"dev": "lawnman js,json lint test",
"lint": "eslint lib/ --fix",
"test": "ava"
}
}Usage
lawnman <ext>[,<ext>,...] <script> [<script...>]\
--and\
<ext>[,<ext>,...] <script> [<script...>]\
--and\
...Examples
Run the test script when any js file change.
lawnman js testWatch js and scss files and compile accordingly
- Runs
npm run babelwhen any js file changes - Runs
npm run compasswhen any scss or png file changes
lawnman js babel --and scss,png compassWatch js files and run multiple npm scripts
Runs npm run test and then npm run format when any js files change
lawnman js test format.lawnmanrc
If you only have one script in package.json that uses lawnman, you can put the arguments into a .lawnmanrc file.
For example, if you have this script in your package.json
{
"scripts": {
"dev": "lawnman cpp,cc,h,hpp,gyp rebuild e2e --and js,json lint test --and scss compass",
"test": "...", ...
}
}You can put the arguments into a .lawnmanrc file to clean up your package.json to have it only run lawnman. Empty lines is like --and in the command line. It also supports comments.
# Build addons and run end-to-end tests
cpp,cc,h,hpp,gyp rebuild e2e
# Lint and test javascript
js,json lint test
# Compile scss
scss compassYour dev script will then look much nicer
{
"scripts": {
"dev": "lawnman",
"test": "...", ...
}
}