active-storage icon indicating copy to clipboard operation
active-storage copied to clipboard

An ActiveRecord like interface for querying localStorage

Active Storage Build status indicator

Usage

<script src='active-storage.js'></script>
<script>
  var Post = Object.create( new ActiveStorage("Post") );
</script>

Link to the ActiveStorage Library and create a new model.

You now have access to your favorite ActiveRecord methods, powered by localStorage!

.new

var p = Post.new({name: "Jesse"});

.create

var p = Post.create({name: "Jesse"});

#save

p.save();

.find

Post.find( 1 );

.findBy

Post.findBy( {name: "Jesse"} );

.where

Post.where( {name: "Jesse"} );

.all

Post.all();

#destroy

p.destroy();

.destroyAll

Post.destroyAll();