gristlabs / ts-interface-builder

Compile TypeScript interfaces into a description that allows runtime validation
Apache License 2.0
132 stars 28 forks source link

feat: support watch mode #18

Open dwjohnston opened 4 years ago

dwjohnston commented 4 years ago

I would like to be able to run this with something like:

ts-interface-builder -o src/ti src/types/*.ts --watch

And have it continually recreate the -ti files, rather than have to run it manually.

dsagal commented 4 years ago

You can do it fairly easily using the chokidar module:

chokidar src/types/*.ts -c 'ts-interface-builder -o src/ti {path}'