Members
isEnv
Utility function to check against the current environment name.
Example, isEnv('development') === true
.
Also available:
isDevelopmentEnv();
isProductionEnv();
runWithMessageAndLimiter
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}
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}
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 |
result |
Array | The result of the previous sequence |
Returns:
A promise for a Dictionary
- Type
- Promise