gulp-msg

show command line messages

Usage no npm install needed!

<script type="module">
  import gulpMsg from 'https://cdn.skypack.dev/gulp-msg';
</script>

README

gulp-msg NPM version

gulp plugin for command line notification

Install with npm

npm install gulp-msg

Usage

var msg = require('gulp-msg');

msg.Info('--', 'Notice!', '*');
msg.Info   ('style: <%= name %>', {name: 'info'});
msg.Success('style: <%= name %>', {name: 'success'});
msg.Warning('style: <%= name %>', {name: 'warning'});
msg.Error  ('style: <%= name %>', {name: 'error'});
msg.Note   ('style: <%= name %>', {name: 'note'});
msg.Time   ('style: <%= name %>', {name: 'time'});

screenshot

API

info, success, warning, error, note, time

For example info Use msg.info for each file into the stream

gulp.src('src/**/*')
    .pipe(msg.info('Notice!')); //'Notice!' for each file

Use msg.flush.info at the and of the stream

gulp.src('src/**/*')
    .pipe(msg.flush.info('Notice!')); //'Notice!' at the and of stream

Use msg.Info from the outside of the stream

msg.Info('Notice!'); //'Notice!' in node.js application

msg.info([before,] message, [after,] [data])

Show message

Parameters

before
after

Type: String

Delimiter before/after the message. Each character is repeated 40 times

Usage

msg.Info('--', 'Notice!', '*')
data

Type: Object

Data for message. Inherited values:

env           - process.env
file          - vinyl file
file.relative - relative path (extra field)
file.basename - basename (extra field)
duration      - duration of streaming
totalDuration - duration from gulpfile start
message

Type: String

Lodash template.

Usage

msg.Info('Enviroment: <%= env.NODE_ENV %>. Foo: <%= foo %>', {foo: bar})
//Enviroment: dev. Foo: bar

License

Copyright (c) 2014-2015 Oleg Istomin Released under the MIT license