Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

percy

Package Overview
Dependencies
Maintainers
3
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

percy

A persistance layer that plays nice with Couchbase

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.2K
decreased by-9.5%
Maintainers
3
Weekly downloads
 
Created
Source

#percy

A persistance layer that plays nice with Couchbase via Couchector

##Usage var Percy = require('percy'), connection, // connection object such as a Couchector (https://www.npmjs.org/package/couchector) validator, // object that has a validate function with a signature of function(model, callback) myCoolIdGenerator; // returns a unique id for this entity

var persistance = new Percy('user', connection, validator);

// createId must be set so Percy knows how to generate unique ids
persistance.createId = function(callback){
    callback(null, myCoolIdGenerator());
};

persistance.add({ userName: 'bob' }, function(error, user){
    if(error){
        console.log(error);
        return;
    }

    console.log(user); // { id: 'myCoolId', userName: 'bob'}
});


// Results in the following db record

KEY                 VALUE
user:myCoolId       {
                        id: 'myCoolId'
                        userName: 'bob'
                    }

Keywords

FAQs

Package last updated on 06 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc