【文件属性】:
文件名称:tail-f:观看文件,如tail-f
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-15 18:21:47
JavaScript
尾f
观看文件,如tail -f
安装
npm install --save zo-tail-f
用法
const tail = require ( 'zo-tail-f' )
let watcher = tail . watch ( 'test/test.log' )
watcher . on ( 'line' , line => {
console . log ( line )
} )
api
tail.watch(文件名,选项)
filename :
options :
encoding :默认:'utf8'
mode :“行”,“块”,“流”,默认值:“行”
interval :毫秒,默认值:0不检查。 有时fs.watch()的延迟过多,要进行更及时的更改,可以设置'interval'参数
【文件预览】:
tail-f-master
----index.js(54B)
----package.json(510B)
----test()
--------test.js(730B)
----LICENSE(1KB)
----.gitignore(929B)
----lib()
--------tail_f.js(3KB)
----README.md(558B)
----.vscode()
--------launch.json(187B)