UNPKG

bookshelf-virtuals-plugin

Version:

A plugin for Bookshelf that allows getting or setting virtual properties on model instances.

18 lines (10 loc) 786 B
# Bookshelf Virtuals Plugin [![Build Status](https://travis-ci.com/bookshelf/virtuals-plugin.svg?branch=master)](https://travis-ci.com/bookshelf/virtuals-plugin) [![Greenkeeper badge](https://badges.greenkeeper.io/bookshelf/virtuals-plugin.svg)](https://greenkeeper.io/) This is a plugin for the [Bookshelf Node.js ORM](https://bookshelfjs.org/) that allows getting or setting virtual (computed) properties on model instances. ## How to use First install the package: npm install bookshelf-virtuals-plugin Then load the plugin using `bookshelf.plugin('bookshelf-virtuals-plugin')`. Now you are all set to define virtual properties on your models. For more information check the online [wiki page](https://github.com/bookshelf/virtuals-plugin/wiki/Bookshelf-Virtuals-Plugin).