banner-watcher
v1.0.1
Published
Strips sandbox blocks out of HTML, like those created by Google Web Designer.
Downloads
1
Readme
Banner Watcher
Command line
npm install -g banner-watcher
cd /path/to/my/output/directory
banner-watcher
As a code package
npm install --save banner-watcher
ornpm install --save-dev banner-watcher
(for use as devDependency).- Import the package.
- Set your directory.
- Register the extensions you want to watch ('.html' recommended).
- Call runOnce to run it a single time or...
- Call watch, and give it a destructor callback if you like.
const BannerWatcher = require('banner-watcher');
const extensions = ['html'];
let bannerWatcher = new BannerWatcher();
bannerWatcher.setDirectory(`${process.cwd()}/tests`);
for (let ext of extensions) {
bannerWatcher.registerExtension('.' + ext);
}
bannerWatcher.watch(function onDestroy() {
console.log('Done watching!');
});
setTimeout(function () {
bannerWatcher.abort();
}, 5000);