Runs systemic-ts systems
import { systemic } from 'systemic-ts';
import { runner } from 'systemic-ts-service-runner';
const system = systemic()
.add('config', initConfig(), { scoped: true })
.add('logger', initLogger()).dependsOn('config')
.add('service', initService()).dependsOn('config', 'logger');
runner(system).start();
npm install systemic-ts-service-runner
import { runner } from 'systemic-ts-service-runner';
import system from './system';
import emergencyLogger from './emergencyLogger';
runner(system, { logger: emergencyLogger }).start().then(components => {
// Do something with the components
});
or with top level await:
import { runner } from 'systemic-ts-service-runner';
import system from './system';
import emergencyLogger from './emergencyLogger';
const components = await runner(system, { logger: emergencyLogger }).start();
// Do something with the components