    import Installer from 'mongoose-data-seed/src/lib/core/installer.js'

public class | source

# Installer

mongoose-data-seed installer

#### Example:

    // create installer
    const installer = new Installer({ seedersFolder: './seeders' });

    // run seeders
    const observable = installer.install();

    // subscribe logger
    observable.subscribe({
      next({ type, payload }) {
        switch (type) {
          case Installer.operations.START:
            console.log('Installer started!');
            break;
          case Installer.operations.SUCCESS:
            console.log('Installer finished successfully!');
            break;
        }
      },
      error({ type, payload }) {
        console.error(`Error: ${type}`);
        console.error(payload.error);
      }
    });

## Static Member Summary

Static Public Members
public static | operations: Object Installer operations constants |

## Constructor Summary

Public Constructor
public | constructor(config: InstallerConfig) Creates mongoose-data-seed installer |

## Member Summary

Public Members
public | config: Object Full configuration object |

## Method Summary

Public Methods
public | getGeneratorConfig(): InstallerConfig get the config that should be written into the `package.json` |
public | install(): Observable Run installer - install `mongoose-data-seeder` |

## Static Public Members

### public static operations: Object source

Installer operations constants

#### Properties:

Name | Type | Attribute | Description
START | string |  | Installation starts.
SUCCESS | string |  | Installation succeed.
ERROR | string |  | Installation finished with an error.

## Public Constructors

### public constructor(config: InstallerConfig) source

Creates mongoose-data-seed installer

#### Params:

Name | Type | Attribute | Description
config | InstallerConfig | optional | Generator config

## Public Members

### public config: Object source

Full configuration object

#### Properties:

Name | Type | Attribute | Description
userPackageJsonPath | string |  | path to the user package.json file.
customSeederTemplateFilename | string | nullable: true | custom seeder template filename.
customSeederTemplatePath | string | nullable: true | custom seeder template path.
userSeedersFolderName | string |  | seeders folder name.
userSeedersFolderPath | string |  | seeders folder path.
userConfigExists | boolean |  | user has a config file?.
userConfigFilename | string | nullable: true | config file name.
userConfigFilepath | string | nullable: true | config file path.
configTemplatePath | string |  | config template path.

## Public Methods

### public getGeneratorConfig(): InstallerConfig source

get the config that should be written into the `package.json`

#### Return:

InstallerConfig | generator config

### public install(): Observable source

Run installer - install `mongoose-data-seeder`

#### Return:

Observable

#### See:

- https://rxjs-dev.firebaseapp.com/api/index/class/Observable