2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Ghost/ghost/adapter-manager
Daniel Lockyer 85d41d0562 Aligned dependencies with resolution values
- this commit brings all dependencies up-to-date with the version set as
  a resolution
2023-10-13 08:37:36 +02:00
..
lib Fixed configUtils and adapter cache issues in E2E tests (#16167) 2023-01-30 14:06:20 +01:00
test Increased adapter manager test coverage 2022-09-06 17:51:57 +08:00
.eslintrc.js Remove trailing commas from .eslintrc.js files 2020-08-04 14:48:07 +01:00
index.js Added @tryghost/adapter-manager module (#38) 2020-04-05 15:54:47 +02:00
package.json Aligned dependencies with resolution values 2023-10-13 08:37:36 +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();