
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Puffer is an extendable Couchbase library for Hapi js. It uses Boom to return nicer DB errors and use Q to provide promises.
You can initialize it in your server and use it in your other files or even other plugins.
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.insert( 'doc1', { color: 'red' } )
.then( (d) -> console.log d )
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.insert( 'doc1', { color: 'red' } )
.then( (d) -> console.log d )
groc
, you can make a copy of in your local version.npm test
. Make sure you have development dependencies installed.FAQs
Extendable Couchbase ODM for Hapi js
The npm package puffer receives a total of 2 weekly downloads. As such, puffer popularity was classified as not popular.
We found that puffer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.