lib/integrations.js
function(name, fn) {
    try {
      // Create options.
      var opts = createInternals(name, fn);
      // Create new integration instance.
      var newIntegration = new Integration(opts);
      // Get key to register with.
      var key = newIntegration.name;
      // Ensure this integration isn't already registered.
      if (integrations[key]) {
        throw new Error('Integration already exists: ' + key);
      }
      // Register integration.
      integrations[key] = newIntegration;
      // Return integration.
      return newIntegration;
    } catch (err) {
      // Wrap errors.
      throw new VError(err, 'Error creating new integration: ' + name);
    }
  }
function(name, fn) {
    try {
      // Create options.
      var opts = createInternals(name, fn);
      // Create new integration instance.
      var newIntegration = new Integration(opts);
      // Get key to register with.
      var key = newIntegration.name;
      // Ensure this integration isn't already registered.
      if (integrations[key]) {
        throw new Error('Integration already exists: ' + key);
      }
      // Register integration.
      integrations[key] = newIntegration;
      // Return integration.
      return newIntegration;
    } catch (err) {
      // Wrap errors.
      throw new VError(err, 'Error creating new integration: ' + name);
    }
  }
function ( name , fn ) { try { // Create options. var opts = createInternals ( name , fn ) ; // Create new integration instance. var newIntegration = new Integration ( opts ) ; // Get key to register with. var key = newIntegration . name ; // Ensure this integration isn't already registered. if ( integrations [ key ] ) { throw new Error ( 'Integration already exists: ' + key ) ; } // Register integration. integrations [ key ] = newIntegration ; // Return integration. return newIntegration ; } catch ( err ) { // Wrap errors. throw new VError ( err , 'Error creating new integration: ' + name ) ; } }
Create new integration class instance and register with singleton map.
@memberof integrations
Create new integration class instance and register with singleton map .