Socket
Socket
Sign inDemoInstall

nedb

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nedb - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

7

lib/datastore.js

@@ -205,2 +205,5 @@ var fs = require('fs')

// In-memory only datastore
if (!self.filename) { return callback(); }
customUtils.ensureDirectoryExists(path.dirname(self.filename), function (err) {

@@ -306,2 +309,5 @@ fs.exists(self.filename, function (exists) {

// In-memory only datastore
if (!self.filename) { return callback(); }
self.datafileSize += newDocs.length;

@@ -524,3 +530,2 @@

module.exports = Datastore;

2

package.json
{
"name": "nedb",
"version": "0.6.0",
"version": "0.6.1",
"author": {

@@ -5,0 +5,0 @@ "name": "tldr.io",

@@ -29,4 +29,13 @@ # NeDB (Node embedded database)

### Creating/loading a database
You can use NeDB as an in-memory only datastore or as a persistent datastore.
```javascript
// In-memory only datastore
var Datastore = require('nedb')
, db = new Datastore(); // Call the constructor without any argument
// No need to call loadDatabase(), you can begin inserting data and query it right away
// Persistent datastore
var Datastore = require('nedb')
, db = new Datastore('path/to/datafile');

@@ -38,2 +47,3 @@

// Of course you can create multiple datastores if you need several

@@ -40,0 +50,0 @@ // collections. For example:

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