Skip to content

Instantly share code, notes, and snippets.

@nilshendriks
Last active January 10, 2021 10:40
Show Gist options
  • Save nilshendriks/a4176aa10c56b6e0f8976e46b1d32414 to your computer and use it in GitHub Desktop.
Save nilshendriks/a4176aa10c56b6e0f8976e46b1d32414 to your computer and use it in GitHub Desktop.
npm scripts to process php files to html files
{
"name": "table",
"version": "1.0.0",
"description": "",
"main": "add.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch:php": "watch -p 'components/**/*.php' -c 'npm run convert:php'",
"convert:php": "echo $FILENAME && my_file=$FILENAME && new_name=${my_file/php/html} && echo ${new_name} && curl -o ${new_name} http://localhost/~nils/tests/table/$FILENAME"
},
"author": "nh",
"license": "ISC",
"devDependencies": {
"onchange": "^7.1.0"
}
}
@nilshendriks
Copy link
Author

use watch-cli for this.

https://github.com/doowb/watch-cli

Install globally with npm
npm i -g watch-cli

or try dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment