lzy-watchpack

1.3.4 • Public • Published

一个用于监控文件变化的包

`` const { DirectoryWatcher } = require('lzy-watchpack')

const wp = new DirectoryWatcher({ directoryList: [dirPath], //传入需要监听的文件夹(绝对路径) poll: 3000 //扫描间隔时间 })

// 定义文件change remove create时的回调
wp.on('change', (path) => { console.log(path, 'change'); }) wp.on('remove', (path) => { console.log(path, 'remove'); }) wp.on('create', (path) => { console.log(path, 'create'); })

// 开/关监听器 wp.watch() wp.stopWatch() ``

Readme

Keywords

none

Package Sidebar

Install

npm i lzy-watchpack

Weekly Downloads

2

Version

1.3.4

License

ISC

Unpacked Size

4.86 kB

Total Files

5

Last publish

Collaborators

  • lzy19926