swish-file-brute

0.3.3 • Public • Published

Brute-force file-based store

This is an implementation of a Swish store backed by a file. If no file is specified, it's memory-only. If the specified file does not exist, it is created.

This module is not suitable for most environments, it is mostly a development tool. it is not safe to use by more than one "connection" at a time. It is also rather inefficient, as it keeps the entire store in memory, and uses tv4 to scan through every record when searching.

var Brute = require('swish-file-brute');
 
// Memory-only (no persistent disk store)
var db = new Brute();
 
// Synchronous - throws error if file open/create fails
var db = new Brute('db.json');
 
// Asynchronous
var db = new Brute('db.json', function (error) {...});
 
// Alternatively
Brute('db.json', function (error, db) {...});

/swish-file-brute/

    Package Sidebar

    Install

    npm i swish-file-brute

    Weekly Downloads

    3

    Version

    0.3.3

    License

    ISC

    Last publish

    Collaborators

    • geraintluff