Skip to content

Commit 3c70b00

Browse files
committed
Added the asStream option.
1 parent 11c2b3c commit 3c70b00

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/parser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
'use strict';
44

5-
const {flushable, gen, many, none} = require('stream-chain');
5+
const {asStream, flushable, gen, many, none} = require('stream-chain');
66
const fixUtf8Stream = require('stream-chain/utils/fixUtf8Stream.js');
77

88
const patterns = {
@@ -466,5 +466,7 @@ const jsonParser = options => {
466466

467467
const parser = options => gen(fixUtf8Stream(), jsonParser(options));
468468

469+
parser.asStream = options => asStream(parser(options), options);
470+
469471
module.exports = parser;
470472
module.exports.parser = parser; // for backward compatibility with 1.x

0 commit comments

Comments
 (0)