0.0.1 • Published 3 years ago

peer-cached-api v0.0.1

Weekly downloads
55
License
-
Repository
-
Last release
3 years ago

peer-cached-api

Let your data swarm like your users do.

Installation

npm install --save peer-cached-api

Import

var PeerCachedClient = require('peer-cached-api/client');

Usage

This library requires an external request module that uses a "request like" interface. More modern libraries can be used through polymorphic-request. Client options support Hyperdrive options.

    var client = new PeerCachedClient({ //hypercore options
        name: 'just-a-test',
        persist: false
    });
    client.requestInstance = request; //request instance
    client.request({ //request options
        uri:'http://localhost:8080/someapi',
        json: true
    }, function(err, res, body){
        //do something with the data
    });

Testing

mocha

Enjoy,

-Abbey Hawk Sparrow