
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
js-list-container
Advanced tools
An evented array list container that augments the standard javascript array without altering the array prototype. Events fire when the list changes or when a contained model is updated.
#List Container
An evented array list container that augments the standard javascript array without altering the array prototype. Events fire when the array changes or when a contained value or model changes.
A simple wrapper/container for array lists that provides a base class to extend without modifying the javascript Array prototype.
npm install js-list-container --save
Simple use without extension...
const ListContainer = require('js-list-container');
const options = {
list:require('./list.json'),
lastRefresh:new Date()
};
const container = new ListContainer( options );
container.size() === options.list.length;
container.forEach(item => {
console.log( item );
});
Simple extension use case...
const MyCollection = function(options) {
const container = this;
ListContainer.extend( this, options );
this.getItem = function(index) {
var list = container.getList();
return list[ index ];
};
};
const collection = new MyCollection( opts );
collection.push( { id:1, created:new Date() } );
collection.push( { id:2, created:new Date() } );
collection.size() === 2;
let item = collection.getItem( 1 );
item.id === 2;
Evented Example
const dash = require('lodash');
const ListContainer = require('js-list-container');
const options = {
list:require('./list.json'),
lastRefresh:new Date()
};
const container = new ListContainer( options );
container.onListChange(function() {
console.log( 'list changed: ', container.lastChangeDate );
});
container.onDataChange(function(oldValue, newValue) {
console.log( 'data changed: ', container.lastChangeDate );
});
// copy of one of the contained models
let originalModel = container.getList()[ 3 ],
changeModel = dash.clone( original );
changeModel.title = 'My New Title';
// do the change will file a data change event and return true
container.updateModel( originalModel, changeModel ) === true;
// this will fire a list change event
let popped = container.pop();
// this will also fire a list change event
container.clear();
// this will not fire a data change event
container.updateModel( originalModel, changeModel ) === false;
All objects are tested using gulp and mocha. You can run tests by doing this:
make test
// or
make watch
// or
make test
// or
npm test
FAQs
An evented array list container that augments the standard javascript array without altering the array prototype. Events fire when the list changes or when a contained model is updated.
The npm package js-list-container receives a total of 11 weekly downloads. As such, js-list-container popularity was classified as not popular.
We found that js-list-container 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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.