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

flat-file-db

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flat-file-db - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

21

index.js

@@ -111,4 +111,5 @@ var fs = require('fs');

var Database = function(path) {
var Database = function(path, opts) {
events.EventEmitter.call(this);
if (!opts) opts = {};

@@ -123,2 +124,3 @@ this.path = path;

this._pending = 0;
this._fsync = opts.fsync !== false;
};

@@ -129,4 +131,3 @@

var writefd = function(self, buf, entry, oldPointer, oldFreelist, cb) {
self._pending++;
fs.write(self.fd, buf, 0, buf.length, entry.pointer, function(err) {
var done = function(err) {
if (!--self._pending) self.emit('drain');

@@ -136,2 +137,8 @@ if (err) return cb(err);

cb();
};
self._pending++;
fs.write(self.fd, buf, 0, buf.length, entry.pointer, function(err) {
if (err || !self._fsync) return done(err);
fs.fsync(self.fd, done);
});

@@ -218,4 +225,4 @@ };

var open = function(path) {
var db = new Database(path);
var open = function(path, opts) {
var db = new Database(path, opts);
db.open();

@@ -225,4 +232,4 @@ return db;

open.sync = function(path) {
var db = new Database(path);
open.sync = function(path, opts) {
var db = new Database(path, opts);
db.openSync();

@@ -229,0 +236,0 @@ return db;

{
"name": "flat-file-db",
"version": "0.1.1",
"version": "0.1.2",
"repository": "git://github.com:mafintosh/flat-file-db.git",

@@ -5,0 +5,0 @@ "author": "Mathias Buus <mathiasbuus@gmail.com>",

@@ -8,2 +8,4 @@ # flat-file-db

[![build status](https://secure.travis-ci.org/mafintosh/flat-file-db.png)](http://travis-ci.org/mafintosh/flat-file-db)
## Usage

@@ -41,3 +43,3 @@

}
db.get('test'); // returns {count:9} which also the persisted value of 'test'
console.log(db.get('test')); // {count:9} which also the persisted value of 'test'
```

@@ -47,2 +49,6 @@

* `db = flatfile(path, opts)` Create a new db instance. Per default fsync is called on all puts. To disable this set `opts.fsync = false`
* `db = flatfile.sync(path, opts)` Same as above except you do not need to wait for the open event
* `db.put(key, val, [cb])` Insert or update new key

@@ -70,2 +76,2 @@

MIT
MIT
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