onchange is very close to being usable as a general-purpose file runner across glob matches in a way I haven't seen with other npm tools.
Here's a quick example of the kind of thing I'm looking at, using https://github.com/drwpow/openapi-typescript to use a schema at docs/whatever.yml to generate src/generated/whatever.ts:
"dev:openapi": "onchange -a 'docs/*.yml' -- openapi-typescript {{file}} --prettier-config . -o src/generated/{{fileBaseNoExt}}.ts",
If there was a flag to only run that once (without actually watching for further changes), I could use the same functionality in build steps without needing to break out any other script stuff.
onchangeis very close to being usable as a general-purpose file runner across glob matches in a way I haven't seen with other npm tools.Here's a quick example of the kind of thing I'm looking at, using https://github.com/drwpow/openapi-typescript to use a schema at
docs/whatever.ymlto generatesrc/generated/whatever.ts:If there was a flag to only run that once (without actually watching for further changes), I could use the same functionality in build steps without needing to break out any other script stuff.