BackboneHTTP provides an HTTP interface that can be used in the browser or from Node.js.
This allows for a iteration of remote collections from the browser using BackboneORM's unified query syntax and iteration methods.
Examples (CoffeeScript)
urlRoot: '/projects' sync: require'backbone-http'syncProject # Find all items with is_active = true Projectfind is_active: true # Iterate through all items with is_active = true in batches of 200 Projecteach is_active: true$each: fetch: 200 consolelog 'Done' # Stream all items with is_active = true in batches of 200 Projectstreamis_active: true$each: fetch: 200 pipe on'finish'-> consolelog 'Done'
Examples (JavaScript)
var Project = BackboneModel;Projectprototypesync = ; // Find all items with is_active = trueProject; // Iterate through all items with is_active = true in batches of 200Project; // Stream all items with is_active = true in batches of 200Project ;
Please checkout the website for installation instructions, examples, documentation, and community!
For Contributors
To build the library for Node.js and browsers:
$ gulp build
Please run tests before submitting a pull request:
$ gulp test --quick
and eventually all tests:
$ npm test