Notifier
Manage CLI and popup notification messages.
Installation
npm i @marknotton/notifier --save-dev
const notifier = require('@marknotton/notifier');
Usage
gulp.task('someTask', () => {
return gulp.src([...])
.pipe(plumber({errorHandler: notifier.error }))
.pipe(concat('ccombined.js'))
.pipe(gulp.dest('/some/location/'))
.pipe(notifier.success())
});
Options
A string will be defined as the message or message shorthand.
notifier.success('js', { project : 'My Project', ...})
Notice the use of a shorthand name as the first parameter. This will look for the keys in the default settings object. So you can list all your messages in one place.
Defining your default settings
You can preset the above options with the settings function. This will be refereed as your default options for every notifier instance.
notifier.settings({
project : 'My Project,
success : 'images/icon.png',
exclusions:'.map',
messages : {
js : 'Javascript files compiled!',
sass : 'Looking gooooood!'
}
});