Wondering what’s next for npm?Check out our public roadmap! »

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

    2.3.3 • Public • Published

    Plugins - Boost

    Build Status npm version npm deps

    Plugin based architecture that supports module loading, custom types, registries, scopes, and more.

    import { Registry, Pluggable } from '@boost/plugin';
    
    export interface Renderable<T> extends Pluggable<T> {
      render(): string | Promise<string>;
    }
    
    const registry = new Registry<Renderable>('boost', 'plugin', {
      validate(plugin) {
        if (typeof plugin.render !== 'function') {
          throw new TypeError('Plugins require a `render()` method.');
        }
      },
    });
    
    const plugin = await registry.load('boost-plugin-example');

    Features

    • Custom plugin types and registries.
    • Node module, file path, and configuration file loading strategies.
    • Multiple module name formats: public, scoped public, scoped private.
    • Structural contracts with life cycle events.
    • Factory function pattern for plugin creation.
    • Asynchronous by default.

    Installation

    yarn add @boost/plugin
    

    Documentation

    https://boostlib.dev/docs/plugin

    Install

    npm i @boost/plugin

    DownloadsWeekly Downloads

    587

    Version

    2.3.3

    License

    MIT

    Unpacked Size

    60.6 kB

    Total Files

    34

    Last publish

    Collaborators

    • avatar