How to use the awilix.ResolutionMode.CLASSIC function in awilix

To help you get started, we’ve selected a few awilix examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inkubux / MediaSpeed / src / lib / container.js View on Github external
export async function configureContainer() {
    const opts = {
        resolutionMode: ResolutionMode.CLASSIC
    };

    // @todo create a bootstrap sequence
    const dataFolder = process.env.DATA_FOLDER || path.join(process.env.HOME, '.media_speed');
    const imagesFolder = path.join(dataFolder, 'cache', 'images');
    const transcodingTempFolder = path.join(dataFolder, 'cache', 'transcoding_temp');
    await fsExtra.ensureDir(dataFolder);
    await fsExtra.ensureDir(imagesFolder);
    await fsExtra.ensureDir(transcodingTempFolder);

    const configFile = path.join(dataFolder, 'config.json');

    if (!fsExtra.existsSync(configFile)) {
        await fsExtra.copy(`${__dirname}/../../config.json.dist`, path.join(dataFolder, 'config.json'));
    }
github dannielhugo / typescript-clean-architecture / src / injector.ts View on Github external
registerAll(): void {
    this.container.loadModules([
      [`${__dirname}/business/**/*.js`, Lifetime.TRANSIENT],
      [`${__dirname}/services/**/*.js`, Lifetime.SINGLETON],
      [`${__dirname}/adapters/**/*.js`, Lifetime.TRANSIENT]
    ], {
        formatName: 'camelCase',
        cwd: '.',
        registrationOptions: {
          resolutionMode: ResolutionMode.CLASSIC
        }
      });

    debug('app:dependency-resolver')(this.container.registrations);
  }
}