JSPM

dbstream-memory

1.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q49679F
  • License MIT

Memory-based database API, compatible with the DatabaseStream API

Package Exports

  • dbstream-memory

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dbstream-memory) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

dbstream-memory

Memory-based database API, compatible with the dbstream API

Usage

var db = require("dbstream-memory");
var connection = db.connect();

// write or update
var cursor = new connection.Cursor()
cursor.write({ id: 1, name: "Hello" });
cursor.write({ id: 2, name: "World" });
cursor.on("finish", function() {
  console.log("Saved 2 objects");
});
cursor.end();

// read
new connection.Cursor()
  .find({ id: 2 })
  .limit( 1 )
  .on("data", function (obj) {
    console.log("Loaded", obj);
  });

API

This module implements the dbstream API. For the complete documention see: https://github.com/avinoamr/dbstream

connect( [object] )
  • object a key-value map of existing objects
  • Returns a dbstream Connection object