How to use the componentsjs.Loader function in componentsjs

To help you get started, we’ve selected a few componentsjs 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 comunica / comunica / packages / runner / lib / Setup.ts View on Github external
public static async instantiateComponent(configResourceUrl: string, instanceUri: string,
                                           properties?: ISetupProperties): Promise {
    if (!Setup.preparedPromises) {
      Setup.preparedPromises = true;
      Setup.preparePromises();
    }

    // Handle optional arguments
    if (!properties) {
      properties = {};
    }
    require('lodash.defaults')(properties, { mainModulePath: process.cwd() });

    // Instantiate the given config file
    const loader = new Loader(properties);
    await loader.registerAvailableModuleResources();
    return await loader.instantiateFromUrl(instanceUri, configResourceUrl);
  }

componentsjs

A semantic dependency injection framework

MIT
Latest version published 5 months ago

Package Health Score

65 / 100
Full package analysis

Popular componentsjs functions