
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
Models for le db.
var Model = require('le-model');
var le = require('le');
var co = require('co');
var db = le('db');
var User = Model('user', db, {
name: {
required: true,
unique: true,
index: true
},
createdAt: {
require: true,
default: function(){ return Date.now() }
}
});
co(function*(){
var user = new User({ name: 'julian' });
yield user.save();
// ...
var user = yield User.byName('julian');
console.log('user created at: %s', user.createdAt);
})();
$ npm install le-model
Expect things to change a lot as this module grows with its usage. So far it's only being used in tiny websites.
Create a new model named name in db with given fields.
Create an instance of model from a data object.
Getter for every field.
Validate current data, throws if invalid.
Save, if validations pass.
Delete.
Load a model by each indexed Field.
{
"field_name": {
// options
}
}
required: Require a field to be set before a record can be saved.unique: Ensure a field's value is unique across all records.index: Index a field to make it accessible via model.by<Field>.default: A function whose return value will be used as default for a field. Called with the context of the model instance.MIT
FAQs
Le model
We found that le-model 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.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.