This is at its core a class object which when created will watch a folder for files copied/moved into it and then perform some sort of predefined processing on the files. The core of the functionality was created for the Data Importer Application but will be made more generic and applicable to other tasks. It will again use the “chokidar” package to provide folder watching capabilities again and for the initial task it will provide basic file copying of the the watched files to a different destination.
Given that the copy should cater for any structure in the source it will use the package “fs-extra” package which provides extra functionality to the the basic node file-system module. This includes a copy which will create in the destination any extra directories needed for the copy to complete (ie. recreate the source directory structure) making the code cleaner.