Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created December 7, 2012 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/4231480 to your computer and use it in GitHub Desktop.
Save Raynos/4231480 to your computer and use it in GitHub Desktop.

p2p

leveldb but p2p

Example

var Database = require("p2p")
    , db = Database({
        namespace: "some unique namespace"
        , uri: "/tmp/database-uri"
    })
    , db2 = Database({
        namespace: "some unique namespace"
        , uri: "/tmp/some-other-uri"
    })

db.set("foo", "bar")
setTimeout(function () {
    db2.get("foo", function (err, value) {
        console.log("value!", value)
    })
}, 500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment