Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backbone-http

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone-http

An HTTP interface for BackboneORM

  • 0.6.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
increased by166.67%
Maintainers
2
Weekly downloads
 
Created
Source

Build Status

logo

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)
class Project extends Backbone.Model
  urlRoot: '/projects'
  sync: require('backbone-http').sync(Project)

# Find all items with is_active = true
Project.find {is_active: true}, (err, projects) ->

# Iterate through all items with is_active = true in batches of 200
Project.each {is_active: true, $each: {fetch: 200}},
  ((project, callback) -> ),
  (err) -> console.log 'Done'

# Stream all items with is_active = true in batches of 200
Project.stream({is_active: true, $each: {fetch: 200}})
  .pipe(new ModelStringifier())
  .on('finish', -> console.log 'Done')
Examples (JavaScript)
var Project = Backbone.Model.extend({
  urlRoot: '/projects'
});
Project.prototype.sync = require('backbone-http').sync(Project);

// Find all items with is_active = true
Project.find({is_active: true}, function(err, projects) {});

// Iterate through all items with is_active = true in batches of 200
Project.each({is_active: true, $each: {fetch: 200}},
  function(project, callback) {},
  function(err) {return console.log('Done');}
);

// Stream all items with is_active = true in batches of 200
Project.stream({is_active: true, $each: {fetch: 200}})
  .pipe(new ModelStringifier())
  .on('finish', function() {return console.log('Done');});

Please checkout the website for installation instructions, examples, documentation, and community!

For Contributors

To build the library for Node.js:

$ npm run build

To build the library for the browser:

$ npm run release

Please run tests before submitting a pull request.

$ npm test

Tests can be run with mocha directly with mocha 'node_modules/backbone-orm/test/spec/**/*.coffee'

Tests may be run in the browser with karma start ./config/karma/manual-config.coffee

Tests may be debugged in the browser with karma start --no-single-run --browsers Chrome ./config/karma/manual-config.coffee, and opening up the debug tab

Keywords

FAQs

Package last updated on 20 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc