Global

Members

isEnv

Source:

Utility function to check against the current environment name. Example, isEnv('development') === true.

Also available:

isDevelopmentEnv();
isProductionEnv();

runWithMessageAndLimiter

Source:

The static-base.run function with a limiter and messenger installed. The last function accepts an object instead of the usual stuff. If the limiter (e.g. changedPath from watcher) matches the given pattern then it continues, otherwise it returns a Promise with an empty array.

How to use:

const message = 'Building pages';
const limiter = 'src/pages/example.hbs';
const sequenceItems = [read];
const pattern = 'src/pages/*.hbs';
const rootDir = __dirname;

runWithMessageAndLimiter
  (message)
  (limiter)
  (...sequenceItems)
  (pattern, rootDir)

Methods

exec(sequences) → {Promise}

Source:

Execute procedure.

Makes a build and depending on the given arguments, runs a web server and watches for changes.

Parameters:
Name Type Description
sequences Array.<sequence>

Array of sequences

Returns:
Type
Promise

Type Definitions

sequence(data, result) → {Promise}

Source:

A sequence is a function that returns a promise for a Dictionary. See the static-base docs for more info.

Parameters:
Name Type Description
data Object

Metadata for the sequence function (default is { changedPath, root })

result Array

The result of the previous sequence

Returns:

A promise for a Dictionary

Type
Promise