Socket
Book a DemoInstallSign in
Socket

neonjs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neonjs

Yet another ODM for NeDB inspired by Mongorito.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

NeonJS

NeonJS Logo

Yet another ODM for NeDB inspired by Mongorito.

npm install neonjs

Tested on:

  • The latest web browsers (Chrome and Firefox).
  • Node LTS v4.3.1
let neonjs = require('neonjs')
let Model = neonjs.Model

// Define your models
class UserModel extends Model {
  
  sayHello () {
    return 'Hello ' + this.name
  }
}

// Assign your models to NeDB instances
let Nedb = require('nedb')
let User = UserModel.for(new Nedb({ filename: 'users.db', autoload: true }))

// Use your models
let run = neonjs.run // Batteries included

run(function * () {
  let user = new User({
    name: 'John Doe'
  })
  
  // No callbacks required :)
  yield user.save()
  
  let users = yield User.find().limit(7).exec()
})

More information later. Stay tuned.

Keywords

odm

FAQs

Package last updated on 09 Jul 2016

Did you know?

Socket

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.

Install

Related posts