3h-join 中文文档教程
3h-join
一个流体解析器。
Example
const join = require('3h-join');
function callback(err, data) {
if (err) {
console.error('Error while reading stream: ', err);
} else {
console.log(`Received: ${JSON.stringify(data)}`);
}
}
join.text({ stream: textStream }, callback);
join.json({
stream: jsonStream,
// parser: myJSONParser
}, callback);
join.form({
stream: formStream,
// parser: myFormParser
}, callback);
APIs
请参阅声明文件
以了解 API。
3h-join
A stream body parser.
Example
const join = require('3h-join');
function callback(err, data) {
if (err) {
console.error('Error while reading stream: ', err);
} else {
console.log(`Received: ${JSON.stringify(data)}`);
}
}
join.text({ stream: textStream }, callback);
join.json({
stream: jsonStream,
// parser: myJSONParser
}, callback);
join.form({
stream: formStream,
// parser: myFormParser
}, callback);
APIs
See the declaration file
to learn the APIs.