firenze-adapter-localstorage
v0.4.0
Published
localStorage adapter for firenze.js ORM
Downloads
3
Maintainers
Readme
firenze-adapter-localstorage
localStorage adapter for firenze.js ORM
$ 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