New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

riaktor

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

riaktor

a minimalist node.js wrapper for riak built with superagent

latest
Source
npmnpm
Version
0.0.9
Version published
Maintainers
1
Created
Source
the riaktor

Riaktor Build Status

a functional style riak wrapper for node

Initialize

var db = require('riaktor');

var url = db.construct_url('localhost', '8098');

db.about_my_config(url);
=> I'm riaktor and I am running on http://localhost:8098

Check Health

db.ping(url, function(res) {
  console.log(res);
});
=> { request_url: 'localhost:8098/ping', data: 'OK' }

Bucket Operations

db.get_buckets(url, function(res) {
  console.log(res);
});
=>  {
      request_url: 'localhost:8098/riak?buckets=true',
      data: [ 'wizard', 'people' ]
    }

db.get_keys_in_bucket(url, 'people', function(res) {
  console.log(res);
});
=>  {
      request_url: 'localhost:8098/buckets/people/keys?keys=true',
      data: [ 'rculliton', 'john_maynard_keynes' ]
    }

Key Operations

db.get_value_from_key(url, 'people', 'rculliton', function(res) {
  console.log(res);
});
=>  {
      request_url: 'localhost:8098/riak/people/rculliton',
      id: 'rculliton',
      data: { email: 'rob@wampum.io' }
    }

var data = {email: 'claire@wampum.io'};

db.post_value_to_key(url, 'people', 'cbelle', data, function(res) {
  console.log(res);
});
=>  {
      request_url: 'localhost:8098/riak/people/cbelle/?returnbody=true',
      id: 'cbelle',
      data: { email: 'claire@wampum.io' }
    }

db.post_value_without_key(url, 'emails', data, function(res) {
  console.log(res);
});
=>  {
      request_url: 'localhost:8098/riak/emails/?returnbody=true',
      id: '4azFyFHu0toaQcc2QRIUTRRqNUy',
      data: { email: 'claire@wampum.io' }
    }

var new_data = {email: 'clairebelle@wampum.io'};

db.update_value_in_key(url, 'people', 'cbelle', new_data, function(res) {
  console.log(res);
});
=>  {
      request_url: 'localhost:8098/riak/people/cbelle/?returnbody=true',
      id: 'cbelle',
      data: { email: 'clairebelle@wampum.io' }
    }

db.delete_value_in_key(url, 'people', 'cbelle', function(res) {
  console.log(res);
});
=>  {
      request_url: 'localhost:8098/riak/people/cbelle',
      value_deleted: true
    }

Keywords

riak

FAQs

Package last updated on 17 May 2014

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