Socket
Socket
Sign inDemoInstall

ormnomnom

Package Overview
Dependencies
55
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ormnomnom

a lightweight orm to silence the orm-y beast


Version published
Weekly downloads
464
decreased by-35.56%
Maintainers
4
Install size
1.96 MB
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 21 Apr 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc