@apisandipas/supermodel

A Bookshelf.js base model with super powers

Usage no npm install needed!

<script type="module">
  import apisandipasSupermodel from 'https://cdn.skypack.dev/@apisandipas/supermodel';
</script>

README

Bookshelf Supermodel

@apiasandipas/supermodel

A Bookshelf.js base model class with super powers.

I just found myself using several plugins and would find cases where they sometimes didnt play nicely. This is an effort to bring those plugins together to a single home that I can reuse.

Installation

yarn add @apisandipas/supermodel

or

npm install @apisandipas/supermodel

Features

  • Convenience CRUD methods: findAll, findById, findOne, create, create, update, destroy, findOrCreate, upsert
  • Opt-in secured password behavior with bcrypt password hashing and authenticate convenience method
  • Consumable as an extensible base class or as a Bookshelf plugin

Roadmap

  • [] Convert to Typescript?
  • [] Rollup build?

API

  • todo: document api here...

Inspiration