Ghost/ghost/adapter-manager
Daniel Lockyer 713a81455d
Deleted types/ folders
- these should no longer be needed because the cross-linking of packages
  makes jsdoc types Just Work ™️
2022-08-04 19:42:22 +02:00
..
lib
test
.eslintrc.js
index.js
package.json Pinned dependencies (#15100) 2022-07-26 16:06:00 +02:00
README.md Tidied up package README and LICENSE files 2022-07-26 15:22:10 +02:00

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();