New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hapi-nedb-connector

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-nedb-connector - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "hapi-nedb-connector",
"version": "0.1.0",
"version": "0.1.1",
"description": "A simple connector for hapi and nedb",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -9,1 +9,44 @@ # hapi-nedb-connector [![NPM version](http://img.shields.io/npm/v/hapi-nedb-connector.svg)](https://www.npmjs.com/package/hapi-nedb-connector) [![Build Status](https://travis-ci.org/jonhester/hapi-nedb-connector.svg?branch=v0.0.2)](https://travis-ci.org/jonhester/hapi-nedb-connector)

```
## Usage
```
var Hapi = require('hapi');
// Create a server with a host and port
var server = new Hapi.Server();
server.connection({
host: 'localhost',
port: 8000
});
server.register({
register: require('hapi-nedb-connector'),
options: {
directory: 'data/'
}
}, function (err) {
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
// Access plugin
var db = server.plugins['hapi-nedb-connector'].db;
// Use requests database and create requests database if it does not exist
db('requests').insert(request.info, function(err, newRequest) {
reply({message: 'request added to database'});
});
}
});
});
// Start the server
server.start(function() {
console.log('Server running at:', server.info.uri);
});
```
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