Ghost/ghost/adapter-manager
Hannah Wolfe b80b90229f Added consistent linting pattern to all packages
refs: https://github.com/TryGhost/Toolbox/issues/188

- some of our older packages used a pattern for linting which missed using test config for linting tests
- we need this to be consistent so that we can add more eslint rules for testing
- two packages also didn't use the lib pattern, which made the lint pattern error - so this was fixed as well
2023-06-13 10:43:29 +01: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
index.js
package.json Added consistent linting pattern to all packages 2023-06-13 10:43:29 +01: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();