Getting Started

Plasmid.js is the browser portion of the Plasmid toolset, and makes working with the IndexedDB API across different browsers and devices.

var database = new Database({
  name: 'todo',
  schema: {
    version: 1,
We create a local database very easily, with a name and begin defining the first version of the schema.
    stores: {
      todo: {
The schema defines the stores in the database, each of which we can fill with data objects.
        indexes: {
          todo: {
Optionally, we can define indexes on these stores.
            key: "todo",
            unique: false,
            multi: false
          }
        }
      },
    },
  }
});
Our index is defined by a key on a property path into the objects we'll put in the store, and flags to determine if we enforce uniqueness and index arrays as one or multiple values.