bookshelf-transient

1.0.0 • Public • Published

bookshelf-transient

Build Status Code Climate Test Coverage GitHub version

Specifies that the field is not persistent. It is used to specify which field of your bookshelf models will not be saved on database.

Installation

After installing bookshelf-transient with npm i --save bookshelf-transient, all you need to do is add it as a bookshelf plugin and enable it on your models.

let knex = require('knex')(require('./knexfile.js').development)
let bookshelf = require('bookshelf')(knex)

// Add the plugin
bookshelf.plugin(require('bookshelf-transient'))

// Enable it on your models
let User = bookshelf.Model.extend({ tableName: 'users', transient: [ 'password', 'confirm_password' ] })

Usage

Nothing fancy here, just keep using bookshelf as usual.

Testing

git clone git@github.com:leonardom/bookshelf-transient.git
cd bookshelf-transient && npm install && npm test

Package Sidebar

Install

npm i bookshelf-transient

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • leonardom