Ghost/ghost/adapter-manager
Daniel Lockyer 841fb1f5c9 Updated @tryghost/errors 1.2.21 to 1.2.24
- we have this set as a higher resolution anyway, but I think having
  some hardcoded lower versions causes some weird yarn issues
- at the very least, this removes any mention of 1.2.21 from our
  yarn.lock
2023-09-12 12:56:14 +02:00
..
lib
test
.eslintrc.js
index.js
package.json Updated @tryghost/errors 1.2.21 to 1.2.24 2023-09-12 12:56:14 +02:00
README.md

Adapter Manager

A manager for retrieving custom "adapters" - can be used to abstract away from custom implementations

Usage

const AdapterManager = require('@tryghost/adapter-manager');

const adapterManager = new AdapterManager({
    pathsToAdapters: [
        '/path/to/custom/adapters',
        '/path/to/default/adapters'
    ]
});

class MailAdapterBase {
    someMethod() {}
}

adapterManager.register('mail', MailAdapterBase);

const mailAdapterInstance = adapterManager.getAdapter('mail', 'direct', mailConfig);

mailAdapterInstance.someMethod();