@agrarium/plugin-list

Agrarium plugin for collecting anything

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
69Feb 12, 2019Nov 7, 2017Minified + gzip package size for @agrarium/plugin-list in KB

Readme

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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.