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.0.4 to 0.1.0

26

lib/index.js

@@ -18,21 +18,19 @@ 'use strict';

var db, collections = {};
var collections = {};
db = {
collection: function (collection) {
if (!collections[collection]) {
if (options.directory) {
options.filename = options.directory + collection + '.nedb';
options.autoload = true;
}
var db = function (collection) {
if (!collections[collection]) {
if (options.directory) {
options.filename = options.directory + collection + '.nedb';
options.autoload = true;
}
collections[collection] = new Datastore(options);
collections[collection] = new Datastore(options);
if (options.directory && options.autoCompactionInterval) {
collections[collection].persistence.setAutocompactionInterval(options.autoCompactionInterval)
}
if (options.directory && options.autoCompactionInterval) {
collections[collection].persistence.setAutocompactionInterval(options.autoCompactionInterval)
}
return collections[collection];
}
};
return collections[collection];
}

@@ -39,0 +37,0 @@ var compact = function (collection) {

{
"name": "hapi-nedb-connector",
"version": "0.0.4",
"version": "0.1.0",
"description": "A simple connector for hapi and nedb",

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

@@ -1,3 +0,8 @@

# hapi-nedb-connector [![NPM version](http://img.shields.io/npm/v/hapi-nedb-connector.svg)](https://www.npmjs.com/package/node-schedule) [![Build Status](https://travis-ci.org/jonhester/hapi-nedb-connector.svg?branch=v0.0.2)](https://travis-ci.org/jonhester/hapi-nedb-connector)
# 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)
A simple connector for hapi and nedb
## Installation
```
npm install hapi-nedb-connector
```

@@ -67,3 +67,3 @@ 'use strict';

var plugin = request.server.plugins['hapi-nedb-connector'];
plugin.db.collection('test').insert({id: 1, test: [1,2,3]});
plugin.db('test').insert({id: 1, test: [1,2,3]});

@@ -116,7 +116,7 @@ done();

var plugin = request.server.plugins['hapi-nedb-connector'];
plugin.db.collection('test').insert({id: 1, test: [1,2,3]});
plugin.db('test').insert({id: 1, test: [1,2,3]});
expect(plugin.db).to.exist();
plugin.db.collection('test').find({ id: 1 }, function (err, docs) {
plugin.db('test').find({ id: 1 }, function (err, docs) {

@@ -123,0 +123,0 @@ expect(docs[0]).to.exist();

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