UNPKG

@naturalcycles/nodejs-lib

Version:
15 lines (14 loc) 541 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transformSplit = void 0; const _binarySplit = require('binary-split'); /** * Input: stream (objectMode=false) of arbitrary string|Buffer chunks, like when read from fs * Output: stream (objectMode=false) or string|Buffer chunks split by `separator` (@default to `\n`) * * Useful to, for example, reading NDJSON files from fs */ function transformSplit(separator = '\n') { return _binarySplit(separator); } exports.transformSplit = transformSplit;