Skip to content

juliangruber/abstract-chunk-transport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

abstract-chunk-transport

Access an abstract-chunk-store over any stream.

abstract chunk store

Example

var transport = require('abstract-chunk-transport');
var Store = require('memory-chunk-store');

var store = new Store(16);
var client = transport.client();
client.pipe(transport.server(store)).pipe(client);

client.put(0, Buffer('0123456789abcdef'), function(err){
  if (err) throw err;

  client.get(0, function(err, buf){
    if (err) throw err;

    console.log('BUF', buf, buf.toString());

    server.close();
    con.end();
  });
});

Installation

$ npm install abstract-chunk-transport

API

.server(store)

.client

License

MIT