How to use load-plugin - 1 common examples

To help you get started, we’ve selected a few load-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unifiedjs / unified-engine / lib / configuration.js View on Github external
function addModule(id, value) {
    var fp = resolve(id, {cwd: root, prefix: prefix})
    var res

    if (fp) {
      try {
        res = require(fp)
      } catch (error) {
        throw fault(
          'Cannot parse script `%s`\n%s',
          relative(root, fp),
          error.stack
        )
      }

      try {
        if (typeof res === 'function') {
          addPlugin(res, value)

load-plugin

Load a submodule, plugin, or file

MIT
Latest version published 7 months ago

Package Health Score

60 / 100
Full package analysis

Popular load-plugin functions