bootstrap

Contains the main bootstrap function.

Since: 3.0.0
Example

// Get the bootstrap function
var bootstrap = require('./../lib/bootstrap.js');

// Initialize Lando in CLI mode
bootstrap({mode: 'cli'})

// Initialize CLI
.tap(function(lando) {
  return lando.cli.init(lando);
})

bootstrap.bootstrap ⇒ Object

The main bootstrap function.

This will:

  1. Instantiate the lando object.
  2. Emit bootstrap events
  3. Initialize plugins

Kind: static property of bootstrap
Returns: Object - An initialized Lando object
Emits: event:pre-bootstrap, event:post-bootstrap
Since: 3.0.0

Param Type Description
opts Object Options to tweak the bootstrap
opts.mode String The mode to run the bootstrap with

Example

// Get the bootstrap function
var bootstrap = require('./../lib/bootstrap.js');

// Initialize Lando in CLI mode
bootstrap({mode: 'cli'})

// Initialize CLI
.tap(function(lando) {
  return lando.cli.init(lando);
})

"event:pre-bootstrap"

Event that allows other things to augment the lando global config.

This is useful so plugins can add additional config settings to the global config.

Kind: event emitted by bootstrap
Since: 3.0.0
Properties

Name Type Description
config Object The global Lando config

Example

// Add engine settings to the config
lando.events.on('pre-bootstrap', function(config) {

  // Get the docker config
  var engineConfig = daemon.getEngineConfig();

  // Add engine host to the config
  config.engineHost = engineConfig.host;

});

"event:post-bootstrap"

Event that allows other things to augment the lando object.

This is useful so plugins can add additional modules to lando before the bootstrap is completed.

Kind: event emitted by bootstrap
Since: 3.0.0
Properties

Name Type Description
lando Object The Lando object

Example

// Add the services module to lando
lando.events.on('post-bootstrap', function(lando) {
  lando.services = require('./services')(lando);
});

results matching ""

    No results matching ""