0.2.0 • Published 1 year ago

@jil/plugin v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@jil/plugin

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

import {Registry, Pluggable} from '@jil/plugin';

export interface Renderable<T> extends Pluggable<T> {
  render(): string | Promise<string>;
}

const registry = new Registry<Renderable>('jil', 'plugin', {
  validate(plugin) {
    if (typeof plugin.render !== 'function') {
      throw new TypeError('Plugins require a `render()` method.');
    }
  },
});

const plugin = await registry.load('jil-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

npm i  @jil/plugin

Documentation

0.2.0

1 year ago

0.1.20

2 years ago

0.1.19

2 years ago

0.1.18

2 years ago

0.1.17

2 years ago

0.1.14

2 years ago

0.1.15

2 years ago

0.1.16

2 years ago

0.1.12

3 years ago

0.1.13

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.4

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago