Finds and prepares d-pac plugins for use in KeystoneJS
Installation
npm install --save keystone-dpac-plugins
Usage
// before `keystone.import( "models" );`// (1) setupvar plugins = ;plugins; // in your models// (2) plugin selectionvar plugins = ; MyModel;
- This will parse your project's
package.json
and iterate over the dependencies, if it encounters a d-pac plugin module it will read out the relevant data and store it. - It returns a list with usable plugins (of type "judge" in the above example), readily consumable by a keystone
Select
field.
Note: The plugin modules have NOT been required at this point and do not take up memory. The actual require
'ing is left up to you.
Example
See comparative-selection plugin for an example of a keystone/d-pac plugin.
License
GPL v3 © d-pac