0.0.3 • Published 7 years ago

@agrarium/plugin-list v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

Agrarium List Plugin

Agrarium plugin for collecting anything to the component context.

Usage

npm i agrarium

Or use it standalone:

npm i @agrarium/plugin-list

In your .agrarium.js file:

const { PluginList } = require('agrarium');

module.exports = {
    src: ['./src/components'],
    plugins: [
        new PluginList({
            collect: (component, context) => ({
                components: context.components ?
                    [].concat(context.components, component.key) :
                    [component.key]
            })
        })
    ]
};

Example of result data

console.log(chunk.context)

{
    components: ['button', 'input', ...]
}

License MIT