Skip to content

Commit

Permalink
Added the asStream option.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhop committed Oct 25, 2024
1 parent 11c2b3c commit 3c70b00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict';

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

const patterns = {
Expand Down Expand Up @@ -466,5 +466,7 @@ const jsonParser = options => {

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

parser.asStream = options => asStream(parser(options), options);

module.exports = parser;
module.exports.parser = parser; // for backward compatibility with 1.x

0 comments on commit 3c70b00

Please sign in to comment.