UNPKG

541 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.transformSplit = void 0;
4const _binarySplit = require('binary-split');
5/**
6 * Input: stream (objectMode=false) of arbitrary string|Buffer chunks, like when read from fs
7 * Output: stream (objectMode=false) or string|Buffer chunks split by `separator` (@default to `\n`)
8 *
9 * Useful to, for example, reading NDJSON files from fs
10 */
11function transformSplit(separator = '\n') {
12 return _binarySplit(separator);
13}
14exports.transformSplit = transformSplit;