Ghost/ghost/adapter-manager
2022-10-17 08:41:28 +00:00
..
lib
test
.eslintrc.js
index.js
package.json Update dependency mocha to v10.1.0 2022-10-17 08:41:28 +00: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();