1.0.0 • Published 8 years ago

fs-change-watcher v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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);
1.0.0

8 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago