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
A class for loading, verifying, and creating plugins. Used by DocPad for years.
Install
- Install:
npm install --save @bevry/pluginloader
- Require:
require('@bevry/pluginloader')
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-node-12/index.js
@bevry/pluginloader/edition-node-12/index.js
is typescript compiled for node.js 12 with require for modules
Usage
Basics
Create your project:
mkdir my-project
cd my-project
Create your plugin:
mkdir myplugin
cd myplugin
npm init
index.js
to:module.exports = function (BasePlugin) { return class MyPlugin extends BasePlugin { constructor (...args) { super(...args) console.log('hello from my plugin') } } }
cd ..
Create your plugin loader:
mkdir myapp
cd myapp
npm init
index.js
to:class BasePlugin { constructor () { console.log('hello from base plugin') } } const PluginLoader = require('@bevry/pluginloader') const pluginLoader = new PluginLoader({ BasePlugin, pluginPath: require('path').resolve(__dirname, '..', 'myplugin') })
cd ..
Run the project:
node myapp/index.js
Ecosystem
- pluginclerk a project for fetching compatible plugins from the npm registry
- docpad-baseplugin the BasePlugin class that DocPad uses
- docpad-plugintester testing helpers for DocPad plugins
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?
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: