Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    node-document-storage-leveldbpublic

    NODE-DOCUMENT-STORAGE-LEVELDB Build Status

    Storage adapter leveldb for node-document ODM for Node.js.

    Installation

      $ npm install node-document-storage-leveldb

    Usage

    Basic:

      var Storage = require('node-document-storage-leveldb');
     
      var storage = new Storage(); // Connect using defaults (i.e. `localhost`) 
     
      var data = {
        keys: ['post/1', 'post/abc'],
        values: [{title: "foo", tags: ['foo', 'bar'], published: true}, {title: "bar", tags: ['baz'], published: false}]
      };
     
      var inspect = require('util').inspect;
     
      console.log('STORAGE: `%s`', storage.name);
      console.log('\nURL: `%s`', storage.url);
     
      storage.set(data.keys, data.values, function(errors, results) {
        console.log("\nSET  %s  ->  %s", inspect(data), inspect(results));
     
        storage.get(['post/1', 'post/abc'], function(errors, results) {
          console.log("\nGET  %s  ->  %s", data.keys, inspect(results));
     
          storage.del(['post/1', 'post/abc'], function(errors, results) {
            console.log("\nDEL  %s  ->  %s", data.keys, inspect(results));
     
            storage.get(['post/1', 'post/abc'], function(errors, results) {
              console.log("\nGET  %s  ->  %s", data.keys, inspect(results));
            });
          });
        });
      });

    For details; see node-document.

    Test

    Local tests:

      $ make test

    Remote tests:

      $ make test-remote

    License

    Released under the MIT license.

    Copyright (c) Jonas Grimfelt

    Keywords

    none

    install

    npm i node-document-storage-leveldb

    Downloadsweekly downloads

    0

    version

    0.1.0

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar