【文件属性】:
文件名称:block-stream2:将输入转换成大小相等的块作为输出
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-23 20:44:52
JavaScript
块流2
将输入转换成大小相等的块作为输出
stream3版本的
例子
const BlockStream = require ( 'block-stream2' ) ;
const through = require ( 'through2' ) ;
process . stdin
. pipe ( new BlockStream ( { size : 16 , zeroPadding : true } ) )
. pipe ( through ( ( buf , enc , next ) => {
const str = buf . toString ( ) . replace ( / [ \x 00- \x 1f ] / g , chr ) ;
console . log ( `buf[ ${ buf . length } ]= ${
【文件预览】:
block-stream2-master
----.npmignore(27B)
----.travis.yml(37B)
----example()
--------stream.js(496B)
----LICENSE(1KB)
----test()
--------thorough.js(2KB)
--------basic.js(718B)
--------nopad-thorough.js(2KB)
--------nopad.js(1KB)
----readme.markdown(2KB)
----index.js(2KB)
----package.json(738B)