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

  • 3.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.6K
increased by17.3%
Maintainers
3
Weekly downloads
 
Created
Source

percy

A persistance layer that plays nice with couchbase@^2.0.0

Usage

var Percy = require('percy'),
    bucket, // bucket object from Couchbase
    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 17 Feb 2015

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