localStorage adapter for firenze.js ORM
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
src
.editorconfig
.eslintrc
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
bower.json
index.js
package.json

README.md

firenze-adapter-localstorage

Build Status npm Join the chat at https://gitter.im/fahad19/firenze

localStorage adapter for firenze.js ORM

Install it with npm or Bower:

$ npm install --save firenze-adapter-localstorage

$ bower install --save firenze-adapter-localstorage

Usage

CommonJS

Useful if you have a CommonJS build set up, like Browserify or Webpack.

With npm:

$ npm install --save firenze-adapter-localstorage

Now you can require it as follows:

var f = require('firenze');
var Database = f.Database;
var LocalStorageAdapter = require('firenze-adapter-localstorage');

var db = new Database({
  adapter: LocalStorageAdapter,
  key: 'my_localstorage_key' // optional, defaults to `firenze_data`
});

Bower

Or Bower:

$ bower installl --save firenze-adapter-localstorage

Can be loaded in your HTML page as follows:

<script src="bower_components/lodash/lodash.min.js"></script>
<script src="bower_components/async/lib/async.js"></script>
<script src="bower_components/bluebird/js/browser/bluebird.min.js"></script>
<script src="bower_components/validator-js/validator.min.js"></script>

<script src="bower_components/firenze/dist/firenze.min.js"></script>
<script src="bower_components/firenze-adapter-localstorage/dist/firenze-adapter-localstorage.min.js"></script>

<script>
// LocalStorage adapter is availble in `firenze.LocalStorageAdapter`
var db = new firenze.Database({
  adapter: firenze.LocalStorageAdapter
});
</script>

Testing

Can be run via npm:

$ npm test

License

MIT © Fahad Ibnay Heylaal