JSPM

@bevry/pluginloader

4.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 148
  • Score
    100M100P100Q81874F
  • License MIT

A class for loading, verifying, and creating plugins. Used by DocPad for years.

Package Exports

  • @bevry/pluginloader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bevry/pluginloader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@bevry/pluginloader

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

A class for loading, verifying, and creating plugins. Used by DocPad for years.

Usage

Complete API Documentation.

Basics

Create your project:

  1. mkdir my-project
  2. cd my-project

Create your plugin:

  1. mkdir myplugin

  2. cd myplugin

  3. npm init

  4. index.js to:

    module.exports = function (BasePlugin) {
        return class MyPlugin extends BasePlugin {
            constructor(...args) {
                super(...args)
                console.log('hello from my plugin')
            }
        }
    }
  5. cd ..

Create your plugin loader:

  1. mkdir myapp

  2. cd myapp

  3. npm init

  4. index.js to:

    import PluginLoader from '@bevry/pluginloader'
    
    class BasePlugin {
        constructor() {
            console.log('hello from base plugin')
        }
    }
    
    const pluginLoader = new PluginLoader({
        BasePlugin,
        pluginPath: require('path').resolve(__dirname, '..', 'myplugin'),
    })
  5. cd ..

Run the project:

  1. node myapp/index.js

Ecosystem

Install

npm

  • Install: npm install --save @bevry/pluginloader
  • Import: import pkg from ('@bevry/pluginloader')
  • Require: const pkg = require('@bevry/pluginloader').default

Editions

This package is published with the following editions:

  • @bevry/pluginloader/source/index.ts is TypeScript source code with Import for modules
  • @bevry/pluginloader aliases @bevry/pluginloader/edition-esnext/index.js
  • @bevry/pluginloader/edition-esnext/index.js is TypeScript compiled against ESNext for Node.js with Require for modules

History

Discover the release history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

  • Benjamin Lupton

Sponsors

No sponsors yet! Will you be the first?

GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

  • Copyright © 2018+ Benjamin Lupton

and licensed under: