1.0.4 • Published 7 years ago
gulp-message v1.0.4
gulp-message
Emit clean, readable log messages from gulp tasks
Usage
1. Get the package
npm install --save gulp-message
2. Import it
Javascript:
const message = require('gulp-message');
Typescript / ES6:
import * as message from 'gulp-message';
Types are bundled with the published package and will be automatically imported.
3. Use it in your gulp tasks
gulp.task('foo', () => {
message.warn(`Well that's not quite right...`);
});
API
message.error(string)
Emit an error message.
message.warn(string)
Emit an warning message.
message.info(string)
Emit an info message.
message.debug(string)
Emit an debug message.
logger(opts)
Create a custom log emitter.
Option | Description | Default |
---|---|---|
prefix | A prefix to append to all outgoing messages - either a string, or [string, style] tuple | '' |
style | The style to apply to the message body | none |
writer | The log message emitter | gutil.log |
Example:
const tableFlip = message.logger({
prefix: '(ノಠ益ಠ)ノ彡┻━┻'
})
tableFlip('Breath in, breath out.')
=> '(ノಠ益ಠ)ノ彡┻━┻ Breathe in, breathe out.'