Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dirty

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dirty - npm Package Compare versions

Comparing version 0.9.7 to 0.9.8

.travis.yml

29

lib/dirty/dirty.js

@@ -24,2 +24,4 @@ if (global.GENTLY) require = GENTLY.hijack(require);

this._writeStream = null;
this._fdRead = null;
this._fdWrite = null;

@@ -96,6 +98,22 @@ this._load();

/**
* Close dirty db file stream, release file handle
*/
Dirty.prototype.close = function() {
if (!this.path) {
return;
}
this._maybeFlush();
var self = this;
fs.close(this._fdRead, function() {
self.emit('read_close', 0);
});
fs.close(this._fdWrite, function() {
self.emit('write_close', 0);
});
};
// Called when a dirty connection is instantiated

@@ -168,2 +186,5 @@ Dirty.prototype._load = function() {

self.emit('load', length);
})
.on('open', function(fd) {
self._fdRead = fd;
});

@@ -179,2 +200,6 @@

});
this._writeStream.on('open', function(fd) {
self._fdWrite = fd;
});
};

@@ -181,0 +206,0 @@

2

package.json
{
"name": "dirty",
"description": "A tiny & fast key value store with append-only disk log. Ideal for apps with < 1 million records.",
"version": "0.9.7",
"version": "0.9.8",
"dependencies": {},

@@ -6,0 +6,0 @@ "main": "./lib/dirty",

@@ -98,2 +98,6 @@ # node-dirty

### dirty.close()
Close the dirty db file handle.
### dirty event: 'load' (length)

@@ -111,4 +115,14 @@

### dirty event: 'read_close' ()
Emitted once the database file read stream closed.
### dirty event : 'write_close' ()
Emitted once the database file write stream closed.
## Tests
[![Build Status](https://travis-ci.org/felixge/node-dirty.png)](https://travis-ci.org/felixge/node-dirty)
Dirty utilizes the [Mocha](http://visionmedia.github.com/mocha/) test framework.

@@ -115,0 +129,0 @@

var config = require('./config');
path = require('path'),
fs = require('fs'),

@@ -7,2 +8,6 @@ dirty = require(config.LIB_DIRTY),

// exists moved from path to fs in node v0.7.1
// https://raw.github.com/joyent/node/v0.7.1/ChangeLog
var exists = (fs.exists) ? fs.exists : path.exists;
function dirtyAPITests(file) {

@@ -12,6 +17,10 @@ var mode = (file) ? 'persistent' : 'transient';

describe('dirty api (' + mode + ' mode)', function() {
function cleanup() {
if (fs.existsSync(file)) {
fs.unlinkSync(file);
}
function cleanup(done) {
exists(file, function(doesExist) {
if (doesExist) {
fs.unlinkSync(file);
}
done();
});
}

@@ -18,0 +27,0 @@

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