This package has been deprecated

Author message:

WARNING: This module has been renamed to fs-onchange. Please install it instead. See https://github.com/soenkekluth/fs-onchange for more information.

fs-change-watcher

1.0.0 • Public • Published

fs-change-watcher

Install

local

npm i --save fs-change-watcher

global

npm i -g fs-change-watcher

Command Line

onchange file.ext npm run build

onchange 'path/**/*.js, path/**/*.scss' execute something

onchange '[file1, file2, file3]' execute something

Node

const watcher = require('fs-change-watcher');
const path = require('path');

const onChangeSass = (obj) => {
  console.log('onChangeSass ', obj);
}


const onChangeAppSccs = (obj) => {
  console.log('onChangeAppSccs ', obj);
}


const onChangeJS = (obj) => {
  console.log('onChangeJS ', obj);
}


const onChangeHTML = (obj) => {
  console.log('onChangeHTML ', obj);
}


const appScssWatcher = watcher.add(path.resolve(__dirname, 'sass/app/_app.scss'), {}, onChangeAppSccs);

watcher.add(path.resolve(__dirname, 'sass') + '/**/*.scss', { ignored: appScssWatcher.src }, onChangeSass);
watcher.add(path.resolve(__dirname, 'js') + '/**/*.js', {}, onChangeJS);
watcher.watch();


watcher.add([
  path.resolve(__dirname, 'html') + '/**/*.html',
  path.resolve(__dirname, 'html5') + '/**/*.html'
], {}, onChangeHTML);

Package Sidebar

Install

npm i fs-change-watcher

Weekly Downloads

10

Version

1.0.0

License

MIT

Last publish

Collaborators

  • soenkekluth