Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
backbone-browserify
Advanced tools
Give your JS App some Backbone with Models, Views, Collections, and Events. - For Browserify
npm install backbone-browserify
Important: You must require jquery-browserify
or Zepto (untested) with Browserify before you require Backbone, just like normal.
Just add it to your browserify require list and use it! Make sure you also have Underscore installed via npm as Backbone will automatically require it.
browserify({
require : [ 'jquery-browserify', 'backbone-browserify' ]
});
... or to alias it to just "backbone":
browserify({
require : { jquery: 'jquery-browserify', backbone: 'backbone-browserify' }
});
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname + '/public'));
app.use(browserify({
require : { jquery: 'jquery-browserify', backbone: 'backbone-browserify' }
}));
});
***Include browserify.js
like this first: <script src="browserify.js"></script>
var $ = jQuery = require('jquery-browserify'),
Backbone = require('backbone-browserify'),
MyView = Backbone.View.extend({
el: 'body',
initialize: function() {
this.render();
},
render: function() {
$(this.el).html('<h1>Oh hi</h1>');
}
});
$(document).ready(function() { var myView = new MyView(); });
... or if you aliased it to 'backbone':
var $ = jQuery = require('jquery'),
Backbone = require('backbone'),
MyView = Backbone.View.extend({
el: 'body',
initialize: function() {
this.render();
},
render: function() {
$(this.el).html('<h1>Oh hi</h1>');
}
});
$(document).ready(function() { var myView = new MyView(); });
FAQs
DEPRECATED, 0.9.9 works with browserify
The npm package backbone-browserify receives a total of 0 weekly downloads. As such, backbone-browserify popularity was classified as not popular.
We found that backbone-browserify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.