@ilabdev/utils
v1.0.0
Published
Utilities for the @ilabdev compiler system
Downloads
1
Readme
@ilabdev/utils
Utilities for the @ilabdev compiler system
Installation & set up
Install @ilabdev/utils
npm install @ilabdev/utils --save-dev
-- OR --
yarn add @ilabdev/utils --dev
Include @ilabdev/utils
in your plugin
const utils = require( '@ilabdev/utils' )
// OR
const {
logger,
stream,
watchFiles,
} = require( '@ilabdev/utils' )
Use the utilities as necessary!
Utilities
logger.log(string message, string color)
A simple console log with the ability to manipulate the color. Available colors can be found here: https://github.com/stgdp/fancy-logger#available-modifiers
logger.error(string message)
A simple console log that styles the text red to indicate an error
logger.disabled(string message)
A simple console log that informs the user the task run has been disabled in the config
stream(object config, function task, function unpipe)
Allows the user to merge streams, used when dealing with areas. config
is the config for the task, task
is the task itself (which receives the area and merged pipes as parameters), unpipe
is called when each stream has completed it's operations
watchFiles(array areas)
Gets the watch paths listed for each area and combines them into a single array, removing any duplicates