tasklemon
tasklemon copied to clipboard
Watch feature
Hi, tasklemon looks neat. Any interest in adding a watch feature to watch files?
Thanks 😄 Folder watching definitely sounds like it'd be a nice addition to Tasklemon, yes! It's a common scripting operation, and should fit in nicely with the other Folder APIs.
I'll first need to understand how it's most commonly used, though. What would you like to use it for?
Until it's added in Tasklemon proper, it's still doable using npm support. Here's what you could do with chokidar:
npm.chokidar.watch(pathToWatch, {
awaitWriteFinish: true
}).on('add', filePath => {
const changedFile = root.file(filePath);
// do things
});