How to use the dirty.prototype function in dirty

To help you get started, we’ve selected a few dirty examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github felixge / node-dirty / test / simple / test-dirty.js View on Github external
require('../common');
var Dirty = require('dirty'),
    EventEmitter = require('events').EventEmitter,
    dirtyLoad = Dirty.prototype._load,
    gently,
    dirty;

(function testConstructor() {
  var gently = new Gently();

  (function testBasic() {
    var PATH = '/foo/bar';
    Dirty.prototype._load = gently.expect(function() {
      assert.equal(this.path, PATH);
    });
    var dirty = new Dirty(PATH);

    assert.ok(dirty instanceof EventEmitter);
    assert.deepEqual(dirty._docs, {});
    assert.deepEqual(dirty._queue, []);

dirty

A tiny & fast key value store with append-only disk log. Ideal for apps with < 1 million records.

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular dirty functions