1.0.4 • Published 7 years ago

gulp-message v1.0.4

Weekly downloads
285
License
MIT
Repository
github
Last release
7 years ago

gulp-message

Build Status Code Climate Dependencies Status npm version

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.

OptionDescriptionDefault
prefixA prefix to append to all outgoing messages - either a string, or [string, style] tuple''
styleThe style to apply to the message bodynone
writerThe log message emittergutil.log

Example:

const tableFlip = message.logger({
    prefix: '(ノಠ益ಠ)ノ彡┻━┻'
})

tableFlip('Breath in, breath out.')
=> '(ノಠ益ಠ)ノ彡┻━┻ Breathe in, breathe out.'