json-around:在对象流周围放置一个 JSON 字符串

时间:2024-06-24 01:02:42
【文件属性】:

文件名称:json-around:在对象流周围放置一个 JSON 字符串

文件大小:4KB

文件格式:ZIP

更新时间:2024-06-24 01:02:42

JavaScript

json-around 在对象流周围放置一个 JSON 字符串。 例子 鉴于此代码 var through = require ( 'through2' ) ; var jsonAround = require ( 'json-around' ) ; var source = through . obj ( ) ; source . pipe ( jsonAround ( 'animals' , { location : 'farm' } ) ) . pipe ( process . stdout ) ; source . write ( { name : 'horse' } ) ; source . write ( { name : 'dog' } ) ; source . write ( { name : 'cow' } ) ; source . end ( )


【文件预览】:
json-around-master
----idea.txt(399B)
----index.js(941B)
----test.js(3KB)
----package.json(604B)
----.gitignore(12B)
----LICENSE.mit(1KB)
----CHANGELOG.md(182B)
----README.md(1KB)

网友评论