mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 19:02:29 +03:00
0a5f600dfe
- we shouldn't need individual LICENSE files because these packages won't be published, so the top-level one applies - also cleaned up README files to remove mentions of Lerna monorepos and install instructions
27 lines
572 B
Markdown
27 lines
572 B
Markdown
# Adapter Manager
|
|
|
|
A manager for retrieving custom "adapters" - can be used to abstract away from custom implementations
|
|
|
|
## Usage
|
|
|
|
```js
|
|
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();
|
|
```
|