@applicvision/js-toolbox
Version:
A collection of tools for modern JavaScript development
21 lines (17 loc) • 506 B
JavaScript
import { parseArguments } from '@applicvision/js-toolbox/args'
import { FileChangeStream } from '../autoreload/streams.js'
let watchedPaths
try {
const result = parseArguments()
.help('Simple file watcher, outputting changes to std out')
.parse()
watchedPaths = result.args
} catch (error) {
console.error(error.message)
process.exitCode = 1
}
if (watchedPaths) {
const fileWatchStream = new FileChangeStream(watchedPaths)
fileWatchStream.pipe(process.stdout)
}