peerdb

0.0.2 • Public • Published

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, id) {
  // `id` is a unique identifier based on the data (content-addressed)
  db.get(id, function (err, data) {
    console.log(data) // '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, id) {
  // `id` is a unique identifier based on the data (content-addressed)
  db.get(id, function (err, data) {
    console.log(data) // 'some data'
 
    // Data can be deleted from the central server and the local database
    db.del(id, function (err) {
      // Data is
    })
  })
})

api

TODO

license

MIT. Copyright (c) Feross Aboukhadijeh.

Package Sidebar

Install

npm i peerdb

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • feross