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

puffer

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puffer

Extendable Couchbase ODM for Hapi js

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

puffer

Build Status npm version

Puffer is an extendable Couchbase ODM for Hapi js. It uses Boom to return nicer DB errors and use Q to provide promises.

Full documation can be found here.

How to use

You can initialize it in your server and use it in your other files or even other plugins.

Single module with many files

In your server.coffee have something like this:

Hapi = require 'hapi'
new require('puffer')( { host: '127.0.0.1', name: 'default' } )

Above line will create an instance of couchbase which you can use in your other files as an example in your userModel.coffee you can use this:

bucket = require('puffer').instance
bucket.create( 'doc1', { color: 'red' } )
      .then( (d) -> console.log d )

Multiple Hapi Plugins

In your server.coffee have something like this:

Hapi = require 'hapi'
db = new require('puffer')( { host: '127.0.0.1', name: 'default' } )

server.register { 
  register: require('myPlugin'), 
  options: { bucket: db } 
}, (err) ->
  throw err if err
  server.start()

Above line will create an instance of couchbase which you should pass to plugins. In your myPlugin module you can do this:

exports.register = (plugin, options, next) ->
  bucket = options.bucket
  bucket.create( 'doc1', { color: 'red' } )
        .then( (d) -> console.log d )

Need More?

  • Find the full list of available methods here.
  • This documentation is generated by groc, you can make a copy of in your local version.
  • You can run tests locally by npm test. Make sure you have development dependencies installed.

FAQs

Package last updated on 22 Jan 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