Skip to content

jhaugh42/chesterfield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chesterfield

npm version Build Status Coverage Status

Chesterfield is wrapper for the Node JS Couchbase SDK for writing Functional Javascript.

Installation

npm install chesterfield --save

Running Tests

git clone https://github.com/binaryalchemist/chesterfield.git
cd chesterfield
npm test

Example

var cb = require('chesterfield');

var cluster = cb.cluster('couchbase://address2couchbase');
var bucket = cb.open(cluster, 'bucket_name', 'password');

var popeMobile = {
    id: 9000,
    type: 'miracle whip'
};

var popeMobileKey = 'vehicle_' + popeMobile.id;

cb.upsert(bucket, popeMobileKey, popeMobile, function(error, result) {
    cb.get(bucket, popeMobileKey, function(error, result) {
        console.log(JSON.stringify(result.value));
    });
});

Contributing

Please see CONTRIBUTING.md for more details on contributing to the repository.