Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
backbone-cappedcollection
Advanced tools
Capped Collections for BackboneJS
Install the module with: npm install backbone-cappedcollection
<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="backbone.js"></script>
<script type="text/javascript" src="lib/index.js"></script>
<script type="text/javascript">
var myColl = new Backbone.CappedCollection([
{name: "Twitter", url: "http://twitter.com/FGRibreau"}, // Will be removed
{name: "Bringr", url: "http://brin.gr"},
{name: "Redsmin", url: "http://redsmin.com"},
], {
// {optional} Capped Collection size (default. 5)
cap:2,
// {optional} From where should it start to remove elements, "first" or "last" (default. first)
capRemove:'first'
});
myColl.length; // == 2
myColl.add({name: "Github", url: "http://github.com"});
myColl.add({name: "NodeJS", url: "http://nodejs.org/"});
myColl.length; // == 2
myColl.toJSON(); // [{"name":"Github","url":"http://github.com"},{"name":"NodeJS","url":"http://nodejs.org/"}]
// Other Backbone methods (.add, .reset, ...) should work as expected as well.
</script>
var Backbone = require('backbone');
// Wrap it
Backbone = require('backbone-cappedcollection')(Backbone);
// [... same as the client-side code above ...]
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
v0.1.0 - First commit
Copyright (c) 2013 Francois-Guillaume Ribreau Licensed under the MIT license.
FAQs
Capped Collections for BackboneJS
The npm package backbone-cappedcollection receives a total of 1 weekly downloads. As such, backbone-cappedcollection popularity was classified as not popular.
We found that backbone-cappedcollection 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.