
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
Endtable is an experimental ORM built on top of Node.js and CouchDB.
The concept? long-lived, self-monitoring, objects that persist only periodically as modifications are made to them.
This paradigm reduces the frequency with which writes are made to the database, and works well for domains such as games.
A single engine object is instantiated and passed as a dependency to an Endtable Class:
var engine = new endtable.Engine({
database: 'people_example',
host: 'localhost',
user: '',
password: '',
errorCallback: function(error) {
// When views aren't found they raise a warning.
sys.puts(JSON.stringify(error));
}
});
Errors that occur in Endtable are propagated up to the errorCallback passed to the Engine's constructor.
Error objects provide the following information:
Endtable Classes describe the ORM-backed objects.
var Dog = endtable.Object.extend(
{
bark: function() {
sys.puts('Woof!!!');
}
},
{
engine: engine,
type: 'dog',
customViews: [
function lowerName(doc) {
if(doc.type=='dog')
emit(doc.name.toLowerCase(),doc);
},
function otherNamedView(doc) { ... }
]
}
);
Once you've created some Endtable Classes simply instantiate them to create auto-persisting CouchDB-backed objects.
var dog = new Dog({
name: 'Spike',
owner: 'Benjamin Coe',
coat: 'soft'
})
var dog2 = new Dog({
name: 'Fluffy',
owner: 'Eric Brown',
coat: 'rough'
}, function(err, message) {
// Called after the first save.
});
The first parameter passed to the constructor provides the instance variables for the object.
An optional callback can be provided for the second parameter and will be executed the first time the object persists to CouchDB.
You can lookup objects based on any of their keys.
Simply call the load method on an Endtable Class:
Dog.load({
keys: ['owner', 'coat'],
key: ['Benjamin Coe', 'soft']
}, function(error, obj) {
if (!error) {
obj[0].bark();
}
})
You can also load objects based on a range of values.
Person.load({
keys: 'age',
startkey: 28,
endkey: 50
}, function(error, obj) {
if (!error) {
for (var i = 0; i < obj.length; i++) {
obj[i].sayName();
}
}
})
This will load individuals with an age ranging from 28 to 50.
You can also load an object with a custom view function applied to it.
Dog.load({
keys: 'name',
customView: 'lowerName'
}, function(error, obj) {
if (!error) {
for (var i = 0; i < obj.length; i++) {
obj[i].sayName();
}
}
})
Run node examples/person.js to get an idea of Endtable in action.
Copyright (c) 2011 Benjamin Coe. See LICENSE.txt for further details.
FAQs
An experimental ORM for CouchDB.
The npm package endtable receives a total of 0 weekly downloads. As such, endtable popularity was classified as not popular.
We found that endtable 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
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.