Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

feross/peerdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

peerdb travis npm downloads

TODO -- WORK IN PROGRESS

Sauce Test Status

features

  • Encrypts files (by default)
  • Modes: central-only, P2P-only (free), hybrid (default)
  • Backed by MaxCDN
  • 100% open source client and server
  • Useful for "serverless websites" (i.e. no backend)

why?

  • Simple API (compare to Amazon S3, CloudFront, requires server-side?)
  • Cheap
  • Using a trustless server to add availability to a P2P app
  • 100% of profits will go to the development of WebTorrent and WebTorrent Desktop

install

npm install peerdb

usage

It's super easy to store data:

var db = require('peerdb')

db.put(Buffer('some data'), function (err, key) {
  // `key` is a unique identifier based on the data (content-addressed)
  db.get(key, function (err, value) {
    console.log(value) // 'some data'
  })
})

To ensure that data remains accessible when no peers are online, store it on a centralized content delivery network (CDN):

var db = require('peerdb')

db.setup({
  apiKey: '...'
})

db.put(Buffer('some data'), function (err, key) {
  // `key` is a unique identifier based on the data (content-addressed)
  db.get(key, function (err, value) {
    console.log(value) // 'some data'

    // Data can be deleted from the central server and the local database
    db.del(key, function (err) {
      // Data is deleted!
    })
  })
})

api

TODO

license

MIT. Copyright (c) WebTorrent, LLC.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published