Skip to content
An in-memory JavaScript database
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
README.md
bower.json
deebee.js
karma.conf.js
package.json

README.md

deebee.js

A JavaScript in-memory database.

Installation

In a browser:

<script src="deebee.js"></script>

Notes

Deebee uses the ES6 Map object to store data.

The ES6 Map object is available in Chrome 38, Firefox 13, Internet Explorer 11 and Safari 7.1. If you need support in earlier versions, you can use a polyfill like es6-collections.

This method will provides a global Deebee object. That means that once you include it, you can use it like this:

var database = new Deebee.Database();
var elements = database.createCollection('elements');
var avatars = database.createCollection('avatars', {
    element: 'elements'
});
var avatar = {
    id: 42,
    name: 'Korra',
    element: { id: 1, name: 'Water' }
};
avatars.put(avatar);

var water = elements.get(1);
// = { id: 1, name: 'Water' }

var partialAvatar = avatars.get(42);
// = { id: 42, name: 'Korra', element: { id: 1 } }

var fullAvatar = avatars.get(42, ['element']);
// = { id: 42, name: 'Korra', element: { id: 1, name: 'Water' } }

Deebee has many more features that will be documented in the near future. In the meantime, take a look at the source.

Author

twitter/cdmckay
Cameron McKay

License

This library is available under the MIT license.

Something went wrong with that request. Please try again.