/node-streamcutter

cut a streams start, end or length

Primary LanguageJavaScriptMIT LicenseMIT

NPM version NPM downloads Dependencies

NPM info

node-streamcutter

cut a streams start, end and length

Usage

remove the first and last 10 bytes from a stream

const streamCutter = require('streamcutter');
const fs = require('fs');

const noStartNoEnd = new streamCutter({start: 10, end: 10});
<stream>.pipe(noStartNoEnd);
noStartNoEnd.pipe(fs.createWriteStream('./cutFile'));

API

new streamCutter([options[, transformerStreamOptions]])

  • options typeof Object
    • options.end
      • typeof number
      • how many bytes to trim from the end
      • default's to 0
    • options.start
      • typeof number
      • how many bytes to trim from the start
      • default's to 0
    • options.length
      • typeof number
      • how many bytes it should be long
      • default's to Infinity
  • transformerStreamOptions

Install

npm install --save streamcutter

License

MIT