thinky-export-schema
Exports a thinky model's schema as a plain object.
Install
npm install thinky-export-schema --save
API
exportSchema(model)
model
argument is a thinky model object- Returns the model's schema as a plain object.
Example
var exportSchema = var User = thinkyUserconsole/*{ fields: { id: 'Number', name: 'String', times: { created: 'Date', updated: 'Date' }, friended: ['String'] }, relationships: { friends: { type: 'hasAndBelongsToMany', rightKey: 'id', leftKey: 'friended' } }, validation: {}}*/
ES6
const User = thinkyUser console/*{ fields: { id: 'Number', name: 'String', times: { created: 'Date', updated: 'Date' }, friended: ['String'] }, relationships: { friends: { type: 'hasAndBelongsToMany', rightKey: 'id', leftKey: 'friended' } }, validation: {}}*/