@naturalcycles/nodejs-lib
Version:
Standard library for Node.js
15 lines (14 loc) • 541 B
JavaScript
;
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;