@agrarium/plugin-list
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @agrarium/plugin-list

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

3.01 kB

Total Files

5

Last publish

Collaborators

  • awinogradov
  • qfox