1.0.1 • Published 9 years ago
mongosockets
Licence
ISC
Version
1.0.1
Deps
6
Vulns
2
Weekly
0
mongosockets
Install
npm install mongosockets
Usage (server)
npm start 3000
Start new worker on port 9000
npm run worker 9000 mongodb://localhost/test
Usage (client)
import {connect} from 'mongosockets';
import maeva, {Model} from 'maeva';
// Define a model
class User extends Model {
static schema = {email: String};
}
// Connect to a mongosockets server
await maeva.connect(connect('ws://localhost:9000'));
// Perform queries
await User.insert({email: 'john@doe.com'});