function Flightplan() {
  this._targets = {};
  this._flights = [];

  this.runtime = Object.freeze({});

  process.on('SIGINT', function() {
    throw new errors.ProcessInterruptedError('Flightplan was interrupted');
  });

  process.on('uncaughtException', function(err) {
    logger.error(err instanceof errors.BaseError ? err.message : err.stack);

    process.exit(1);
  });
}
A flightplan is a set of subsequent flights to be executed on one or more
hosts. Configuration is handled with the `target()` method.

```javascript
var plan = require('flightplan');
```

### Flights
A flight is a set of commands to be executed on one or more hosts. There are
two types of flights:

#### Local flights

Commands in local flights are executed on the **localhost**.

```javascript
plan.local(function(transport) {
  transport.hostname(); // prints the hostname of localhost
});
```

#### Remote flights

Commands in remote flights are executed in **parallel** against remote hosts.

```javascript
plan.remote(function(transport) {
  transport.hostname(); // prints the hostname(s) of the remote host(s)
});
```

You can define multiple flights of each type. They will be executed in the
order of their definition. If a previous flight failed, all subsequent
flights won't get executed. For more information about what it means for
a flight to fail, see the section about `Transport`.

```javascript
// executed first
plan.local(function(transport) {});

// executed if first flight succeeded
plan.remote(function(transport) {});

// executed if second flight succeeded
plan.local(function(transport) {});

// ...
```

### Tasks
Flightplan supports optional tasks to run a subset of flights.

```javascript
// fly deploy:<target>
plan.local('deploy', function(transport) {});

// fly build:<target>
plan.local('build', function(transport) {});

// fly deploy:<target> or...
// fly build:<target>
plan.local(['deploy', 'build'], function(transport) {});
plan.remote(['deploy', 'build'], function(transport) {});
```

If no task is specified it's implicitly set to "default". Therefore,
`fly <target>` is the same as `fly default:<target>`.

```javascript
// fly <target>
plan.local(function(transport) {});
// is the same as...
plan.local('default', function(transport) {});
// "default" + other tasks:
plan.remote(['default', 'deploy', 'build'], function(transport) {});
```

@class Flightplan
@return {Object} flightplan