Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npmlog

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npmlog - npm Package Compare versions

Comparing version 2.0.4 to 3.0.0

36

log.js

@@ -9,2 +9,5 @@ 'use strict'

var ansi = require('ansi')
var setBlocking = require('set-blocking')
setBlocking(true)
log.cursor = ansi(process.stderr)

@@ -18,2 +21,3 @@ log.stream = process.stderr

this.cursor.enabled = true
this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled})
}

@@ -23,2 +27,3 @@ log.disableColor = function () {

this.cursor.enabled = false
this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled})
}

@@ -29,3 +34,3 @@

log.gauge = new Gauge(log.cursor)
log.gauge = new Gauge(log.cursor, {tty: log.stream})
log.tracker = new Progress.TrackerGroup()

@@ -36,18 +41,20 @@

var gaugeTheme = undefined
var unicodeEnabled = undefined
log.enableUnicode = function () {
gaugeTheme = Gauge.unicode
log.gauge.setTheme(gaugeTheme)
unicodeEnabled = true
this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled})
}
log.disableUnicode = function () {
gaugeTheme = Gauge.ascii
log.gauge.setTheme(gaugeTheme)
unicodeEnabled = false
this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled})
}
var gaugeTemplate = undefined
log.setGaugeThemeset = function (themes) {
this.gauge.setThemeset(themes)
}
log.setGaugeTemplate = function (template) {
gaugeTemplate = template
log.gauge.setTemplate(gaugeTemplate)
this.gauge.setTemplate(template)
}

@@ -103,5 +110,5 @@

log.clearProgress = function () {
if (!this.progressEnabled) return
this.gauge.hide()
log.clearProgress = function (cb) {
if (!this.progressEnabled) return cb && process.nextTick(cb)
this.gauge.hide(cb)
}

@@ -211,6 +218,3 @@

this.cursor = ansi(this.stream, { enabled: colorEnabled })
var options = {}
if (gaugeTheme != null) options.theme = gaugeTheme
if (gaugeTemplate != null) options.template = gaugeTemplate
this.gauge = new Gauge(options, this.cursor)
this.gauge.setWriteTo(this.cursor, this.stream)
}

@@ -217,0 +221,0 @@

@@ -5,3 +5,3 @@ {

"description": "logger for npm",
"version": "2.0.4",
"version": "3.0.0",
"repository": {

@@ -21,3 +21,4 @@ "type": "git",

"are-we-there-yet": "~1.1.2",
"gauge": "~1.2.5"
"gauge": "~2.5.0",
"set-blocking": "~2.0.0"
},

@@ -24,0 +25,0 @@ "devDependencies": {

@@ -101,4 +101,10 @@ # npmlog

Overrides the default gauge template.
Set a template for outputting the progress bar. See the [gauge documentation] for details.
[gauge documentation]: https://npmjs.com/package/gauge
## log.setGaugeThemeset(themes)
Select a themeset to pick themes from for the progress bar. See the [gauge documentation] for details.
## log.pause()

@@ -197,1 +203,10 @@

* `messageRaw` {Array} Arguments to `util.format()`
# Blocking TTYs
We use [`set-blocking`](https://npmjs.com/package/set-blocking) to set
stderr and stdout blocking if they are tty's and have the setBlocking call.
This is a work around for an issue in early versions of Node.js 6.x, which
made stderr and stdout non-blocking on OSX. (They are always blocking
Windows and were never blocking on Linux.) `npmlog` needs them to be blocking
so that it can allow output to stdout and stderr to be interlaced.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc