How to use the unwatchFile function from fs-extra

Find comprehensive JavaScript fs-extra.unwatchFile code examples handpicked from public code repositorys.

243
244
245
246
247
248
249
250
251
- fs.rmdir():删除文件夹
- fs.stat():返回由传递的文件名标识的文件的状态。相关阅读:fs.fstat(),fs.lstat()
- fs.symlink():创建指向文件的新符号链接
- fs.truncate():将传递的文件名标识的文件截断为指定的长度。有关:fs.ftruncate()
- fs.unlink():删除文件或符号链接
- fs.unwatchFile():停止监视文件上的更改
- fs.utimes():更改通过传递的文件名标识的文件的时间戳。有关:fs.futimes()
- fs.watchFile():开始监视文件上的更改。有关:fs.watch()
- fs.writeFile():将数据写入文件。有关:fs.write()
fork icon0
star icon12
watch icon1

+ 13 other calls in file

2487
2488
2489
2490
2491
2492
2493
2494
2495
2496

let file = require.resolve(__filename)

fs.watchFile(file, () => {

    fs.unwatchFile(file)

    console.log(`Update ${__filename}`)

    delete require.cache[file]
fork icon19
star icon1
watch icon1

+ 19 other calls in file

function icon

fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)