How to use the disableColor function from npmlog

Find comprehensive JavaScript npmlog.disableColor code examples handpicked from public code repositorys.

235
236
237
238
239
240
241
242
243
244
## log.enableColor()

Force colors to be used on all messages, regardless of the output
stream.

## log.disableColor()

Disable colors on all messages.

## log.pause()
fork icon19
star icon22
watch icon13

+ 9 other calls in file

41
42
43
44
45
46
47
48
49
50
log.heading = config.get('heading') || 'npm'

if (enableColorStderr)
  log.enableColor()
else
  log.disableColor()

if (config.get('unicode'))
  log.enableUnicode()
else
fork icon0
star icon1
watch icon0

27
28
29
30
31
32
33
34
35
36
37
38
  process.exit(1);
}


// if --no-color is passed
if (prog.opts && Object.hasOwnProperty.call(prog, 'color') && !prog.opts.color) {
  log.disableColor();
}


log.info('it worked if it ends with', 'ok');
log.verbose('cli', process.argv);
fork icon0
star icon0
watch icon0