Lando ⇒ Lando

The class to instantiate a new Lando

Generally you will not need to do this unless you are using Lando to build your own interface.

Check out ./bin/lando.js in this repository for an example of how we instantiate lando for usage in a CLI.

Since: 3.0.0

Param Type Description
[options] Object Options to initialize a Lando object with

Returns: Lando - An initialized Lando instance
Example

// Get a new lando instance
const Lando = require('lando');
const lando = new Lando({
  logLevelConsole: LOGLEVELCONSOLE,
  userConfRoot: USERCONFROOT,
  envPrefix: ENVPREFIX,
  configSources: configSources,
  pluginDirs: [USERCONFROOT],
  mode: 'cli'
});

lando.events:pre-bootstrap-config()

Event that runs before we bootstrap config.

Since: 3.0.0
Properties

Name Type Description
lando Lando The lando object

Example

lando.events.on('pre-bootstrap-config', lando => {
  // My codes
});

lando.events:pre-bootstrap-tasks()

Event that runs before we bootstrap tasks.

Since: 3.0.0
Properties

Name Type Description
lando Lando The lando object

Example

lando.events.on('pre-bootstrap-tasks', lando => {
  // My codes
});

lando.events:pre-bootstrap-engine()

Event that runs before we bootstrap the engine.

Since: 3.0.0
Properties

Name Type Description
lando Lando The lando object

Example

lando.events.on('pre-bootstrap-engine', lando => {
  // My codes
});

lando.events:pre-bootstrap-app()

Event that runs before we bootstrap the app.

Since: 3.0.0
Properties

Name Type Description
lando Lando The lando object

Example

lando.events.on('pre-bootstrap-app', lando => {
  // My codes
});

lando.events:post-bootstrap-config()

Event that runs after we bootstrap config

Since: 3.0.0
Properties

Name Type Description
lando Lando The Lando object

Example

lando.events.on('post-bootstrap-config', lando => {
  // My codes
});

lando.events:post-bootstrap-tasks()

Event that runs after we bootstrap tasks

Since: 3.0.0
Properties

Name Type Description
lando Lando The Lando object

Example

lando.events.on('post-bootstrap-tasks', lando => {
  // My codes
});

lando.events:post-bootstrap-engine()

Event that runs after we bootstrap the engine

Since: 3.0.0
Properties

Name Type Description
lando Lando The Lando object

Example

lando.events.on('post-bootstrap-engine', lando => {
  // My codes
});

lando.events:post-bootstrap-app()

Event that runs after we bootstrap the app

Since: 3.0.0
Properties

Name Type Description
lando Lando The Lando object

Example

lando.events.on('post-bootstrap-app', lando => {
  // My codes
});

lando.bootstrap([level]) ⇒ Promise

Bootstraps Lando, this should

  1. Emit bootstrap events
  2. Auto detect and then load any plugins
  3. Augment the lando object with additional methods

You will want to use this after you instantiate lando via new Lando(config). There are four available bootstrap levels and each provides different things. The run in the order presented.

 config     Autodetects and loads any plugins and merges their returns into
            the global config

 tasks      Autodetects and loads in any tasks along with recipe inits and
            init sources

 engine     Autodetects and moves any plugin scripts, adds `engine`, `shell`,
            `scanUrls` and `utils` to the lando instance

 app        Autodetects and loads in any `services` and `recipes` and also adds `yaml
            and `factory` to the lando instance.

Check out ./bin/lando.js in this repository for an example of bootstraping lando for usage in a CLI.

Emits: lando.events:pre-bootstrap-config, lando.events:pre-bootstrap-tasks, lando.events:pre-bootstrap-engine, lando.events:pre-bootstrap-app, lando.events:post-bootstrap-config, lando.events:post-bootstrap-tasks, lando.events:post-bootstrap-engine, lando.events:post-bootstrap-app
Since: 3.0.0

Param Type Default Description
[level] String app Level with which to bootstrap Lando

Returns: Promise - A Promise
Example

// Bootstrap lando at default level and then exit
lando.bootstrap().then(() => process.exit(0))l

lando.getApp([startFrom], [warn]) ⇒ App

Gets a fully instantiated App instance.

Lando will also scan parent directories if no app is found in startFrom

Since: 3.0.0

Param Type Default Description
[startFrom] String process.cwd() The directory to start looking for an app
[warn] Boolean true Show a warning if we can't find an app

Returns: App - Returns an instantiated App instandce.
Example

const app = lando.getApp('/path/to/my/app')

results matching ""

    No results matching ""