pipelining

2.2.3 • Public • Published

pipelining

Xhr chunked stream client for the browser and NodeJS

HOW TO USE

front-end

const pipelining = require('pipelining');
 
const reader = pipelining('/test');
 
function read() {
  reader.read().then(partial => {
    if (partial.done) {
      return;
    }
 
    handle(partial.data).then(read);
  });
}
 
read();

back-end

const pipelining = require('pipelining');
// http handler
function (req, res) {
  res.write(pipelining.pack(1));
  // after several seconds..
  res.write(pipelining.pack({ tom: 'test' }));
  // after 1 min..
  res.end();
}

TODO:

  1. node.js version
  2. headers support

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.2.31latest

Version History

VersionDownloads (Last 7 Days)Published
2.2.31
2.2.21
2.2.10
2.2.00
2.1.17
2.1.00
1.2.20
1.2.00
1.1.00
1.0.00

Package Sidebar

Install

npm i pipelining

Weekly Downloads

9

Version

2.2.3

License

ISC

Last publish

Collaborators

  • tomwan