Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Generator-based query interface for rethinkdb.
A simple wrapper around the excellent rethinkdb lib, with generator support, and some modeling goodness thrown in.
$ npm install remodel
var r = require('rethinkdb');
var co = require('co');
var remodel = require('remodel')('localhost');
var User = remodel.create('Users');
co(function *() {
var dbList = yield remodel(r.dbList());
var user = yield User.filter({email: 'a@test.com'});
})();
var r = require('rethinkdb');
// Provide connection details when requiring remodel.
// These connection details are passed directly to reql-then
// which sets up a connection pool for you
remodel = require('remodel'){
host: 'localhost',
port: 28015,
db: 'test',
authKey: '',
maxPoolSize: 10 // set to 1 to disable connection pooling
});
// query interface
function *() {
// accepts any rethinkdb query
// returns actual results, not a cursor
yield remodel.query(r.dbList());
yield remodel.query(r.db('test').tableList());
yield remodel.query(r.db('test').table('Users').insert({email: 'test@test.com'}));
// aliases
yield remodel.q(r.dbList());
yield remodel(r.dbList());
}
// model interface
var User = remodel.create('Users'); // pass the table name
function *() {
yield User.all(); // returns all users
// add your own helper finder methods
User.findByEmail = function *(email) {
return yield this.filter({email: email.trim().toLowerCase()});
}
// use regular rethinkdb querying
var user = yield User.get(1234); // primary key lookup
var users = yield User.filter({email: 'test@test.com'});
var users = yield User.getAll('test@test.com', {index: 'email'}); // use an index for faster querying
// complete list
yield User.between
yield User.count
yield User.filter
yield User.forEach
yield User.get
yield User.getAll
yield User.groupBy
yield User.groupedMapReduce
yield User.indexCreate
yield User.indexList
yield User.indexWait
yield User.info
yield User.insert
yield User.limit
yield User.map
yield User.orderBy
yield User.pluck
yield User.skip
yield User.union
yield User.withFields
yield User.without
}
MIT
FAQs
Generator-based query interface for rethinkdb.
The npm package remodel receives a total of 3 weekly downloads. As such, remodel popularity was classified as not popular.
We found that remodel 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.