【文件属性】:
文件名称:hook-writable-stream:连接到Node.js可写流
文件大小:4KB
文件格式:ZIP
更新时间:2021-05-03 23:01:15
JavaScript
连接到Node.js可写流
基于要点。 当您需要测试诸如stdout之类的Node可写流时很有用。
安装
$ npm install --save-dev hook-writable-stream
用法
使用回调
var hookWritableStream = require ( 'hook-writable-stream' ) ;
var hook = hookWritableStream ( process . stdout , false , function ( string ) {
//=> string === 'hooked!\n'
} ) ;
console . log ( 'hooked!' ) ;
hook . unhook ( ) ;
console . log ( 'unhooked!' ) ;
//=> 'unhooked!' is shown on you
【文件预览】:
hook-writable-stream-master
----.travis.yml(251B)
----index.js(667B)
----test.js(1KB)
----package.json(823B)
----.gitignore(29B)
----README.md(2KB)
----.jshintrc(227B)
----.editorconfig(188B)
----.gitattributes(12B)