Skip to content
This repository has been archived by the owner on Jul 31, 2022. It is now read-only.

rnsloan/holborn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

holborn Build Status

A datastore kind of like a cross between Backbone's Model and Collection

Getting started

nodejs

npm install holborn

Browser

browser/holborn.js

Requires IE9+

API

Initialising

Create a new store by initialising with the keys

var store = new Holborn['name', 'age', 'sex']

add

store.add({name: 'john', age: 15, sex: 'male'})

store.add({name: 'frank', age: 27, sex: 'male'},{name: 'mary', age: 23, sex: 'female'})

all

store.all() >>
[{id: 1, name: 'frank', age: 27, sex: 'male'},{id: 2, name: 'mary', age: 23, sex: 'female'}]

find

store.find('name', 'frank') >>
[{id: 1, name: 'frank', age: 23, sex: 'male'}]

store.find({age: 23, name: 'frank'}) >>
[{id: 1, name: 'frank', age: 23, sex: 'male'}]

length

store.length() >>
2

remove

test.remove('age', 23)

test.remove({age: 23, name: 'frank'})

update

test.update({name: 'frank', age: 23}, {name: 'roger'})

test.update({age: 23, name: 'keith'}, {name: 'roger', age: 45})

Development

Running spec tests and linting

  $ grunt test

Coverage (you will need to pipe the results)

  $ grunt cov > cov.html

Building coffeescript to js

  $ grunt build

Bump the version

  $ grunt bump

Linting coffeescript (by rules defined in coffeelint.json)

  $ grunt lint

Watching files for changes. Will trigger test job on file changes

  $ grunt watch

License

MIT

About

A datastore kind of like a cross between Backbone's Model and Collection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published