Socket
Book a DemoInstallSign in
Socket

peerdb

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peerdb

TODO

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

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.

Keywords

db

FAQs

Package last updated on 16 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts