Wondering what’s next for npm?Check out our public roadmap! »

    ormnomnom

    7.1.0 • Public • Published

    ormnomnom

    ORMnomnom is yet another Node ORM. It is specifically for use with postgres (via pg), exposes single-async-events as bluebird promises, and exposes async-iterables as streams. It requires a modern version of Node (v4+).

    const orm = require('ormnomnom')
    
    class Package {
      constructor (opts) {
        Object.assign(this, opts)
      }
    }
    
    class Author {
      constructor (opts) {
        Object.assign(this, opts)
      }
    }
    
    const PackageObjects = orm(Package, {
      id: { type: 'integer' },
      name: { type: 'string', pattern: '^[a-z0-9]$'},
      author: orm.fk(Author)
    })
    
    const AuthorObjects = orm(Author, {
      id: { type: 'integer' },
      name: { type: 'string', pattern: '^[a-z0-9]$'},
      email: { type: 'string', format: 'email'}
    })
    
    PackageObjects.filter({'author.name:startsWith': 'Gary'}).then(objects => {
      // list of objects
    })

    Documentation

    License

    MIT

    Keywords

    Install

    npm i ormnomnom

    DownloadsWeekly Downloads

    340

    Version

    7.1.0

    License

    MIT

    Unpacked Size

    204 kB

    Total Files

    45

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar