stream-cut-header

1.0.0 • Public • Published

stream-cut-header

Hep cut the header from a response or request stream ,return the header-string and the left stream.

var cutHeader=require('../index.js');
 
var fs = require('fs');
var simpleStream = fs.createReadStream(__dirname + '/stream_simple.txt');
cutHeader(simpleStream, function (err, header, stream) {
    console.log("header:"+header.toString());
    stream.on('data', function (trunk) {
        console.log("part of body:"+trunk.toString());
    });
});

Readme

Keywords

Package Sidebar

Install

npm i stream-cut-header

Weekly Downloads

7

Version

1.0.0

License

GPL-3.0

Last publish

Collaborators

  • chianquan