Socket
Socket
Sign inDemoInstall

@boost/plugin

Package Overview
Dependencies
54
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @boost/plugin

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


Version published
Maintainers
1
Install size
3.47 MB
Created

Readme

Source

Plugins - Boost

build status npm version

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
  • https://boostlib.dev/api/plugin

Keywords

FAQs

Last updated on 01 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc