bookshelf-strip-save

1.0.5 • Public • Published

Bookshelf Strip Save

This plugin works with Bookshelf.js, available here http://bookshelfjs.org. This plugin will automatically strip any attributes set on a model that's not the name of a column of its associated table before it's saved. This is useful for example if you are receiving "dirty" data.

It does this by relying on bookshelf-column-cache to check for a whitelist of valid column names.

requires async syntax to work.

Installation

npm install bookshelf-strip-save bookshelf-column-cache

Then in your bookshelf configuration:

var bookshelf = require('bookshelf')(knex);
bookshelf.plugin(require('bookshelf-strip-save');
bookshelf.plugin(require('bookshelf-column-cache');

Package Sidebar

Install

npm i bookshelf-strip-save

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

63.4 kB

Total Files

13

Last publish

Collaborators

  • 1mike12