Skip to content

distribute API data among peers using a hypercore cache

Notifications You must be signed in to change notification settings

khrome/peer-cached-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

distribute API data among peers using a hypercore cache

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published