Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A browser database with optional multi-device syncronization
JavaScript CSS
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
src
static
test
.bowerrc
.editorconfig
.gitignore
.jshintrc
.npmignore
CHANGELOG
Gruntfile.js
build.js
karma-e2e.conf.js
karma.conf.js
package.json
readme.md

readme.md

Plasmid

Plasmid is a storage solution for offline-first web applications, offering consistent master/slave updates to keep multiple browser instances up to do between a single server.

Plasmid is focused on uses with per-user databases. Such as task and todo lists, note management, writing tools, and other uses.

MVC frameworks are very easy to integrate with Plasmid, especially when using data binding libraries with your client-side templates. Results from Plasmid database queries can be bound to in your templates, and the results can automatically update when new data is created or updated underneath, creating a very smooth experience.

See more details at the Plasmid website

http://plasmidhq.github.io/plasmid/

Usage

To connect to a Plasmid database, you'll need to source the required Javascript files, and setup the needed configuration.

var database = new plasmid.Database({
    name: 'todo',

Defining a database is a simple matter of spelling out the stores available to place objects into, and what indexes they might have on their properties.

    schema: {
        version: 1,
        stores: {
            todo: {
                sync: true,
                indexes: {
                    todo: {key: "completed", unique: false, multi: false}
                }
            },
        },
    }
});

Stores are easily accessable

var todos = database.stores.todo;
todos.put(null, {
    text: "Learn how to use Plasmid.js!",
    completed: false
})

And data is easily updated

todos.get(key)
.then(function(todo) {
    todo.completed = true;
    todos.put(key, todo);
});

You can read a lot more at the API Reference.

Something went wrong with that request. Please try again.