aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npmlog/node_modules/gauge/plumbing.js
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-06-24 13:43:51 -0700
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2016-06-27 11:46:15 +0200
commitd538811fc8b920f3f36d5f21a4c23e270367ceb0 (patch)
tree11cee6c00aa843f16a71819039396f80bf6abe22 /deps/npm/node_modules/npmlog/node_modules/gauge/plumbing.js
parent1db31a34948eee311abd9881bbf5d906d0cd678b (diff)
downloadandroid-node-v8-d538811fc8b920f3f36d5f21a4c23e270367ceb0.tar.gz
android-node-v8-d538811fc8b920f3f36d5f21a4c23e270367ceb0.tar.bz2
android-node-v8-d538811fc8b920f3f36d5f21a4c23e270367ceb0.zip
deps: upgrade npm to 3.10.2
Contains the following npm releases: - https://github.com/npm/npm/releases/tag/v3.9.6 - https://github.com/npm/npm/releases/tag/v3.10.0 - https://github.com/npm/npm/releases/tag/v3.10.1 - https://github.com/npm/npm/releases/tag/v3.10.2 PR-URL: https://github.com/nodejs/node/pull/7410 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'deps/npm/node_modules/npmlog/node_modules/gauge/plumbing.js')
-rw-r--r--deps/npm/node_modules/npmlog/node_modules/gauge/plumbing.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/plumbing.js b/deps/npm/node_modules/npmlog/node_modules/gauge/plumbing.js
new file mode 100644
index 0000000000..589a9c9287
--- /dev/null
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/plumbing.js
@@ -0,0 +1,47 @@
+'use strict'
+var consoleControl = require('console-control-strings')
+var renderTemplate = require('./render-template.js')
+var validate = require('aproba')
+
+var Plumbing = module.exports = function (theme, template, width) {
+ if (!width) width = 80
+ validate('OAN', [theme, template, width])
+ this.showing = false
+ this.theme = theme
+ this.width = width
+ this.template = template
+}
+Plumbing.prototype = {}
+
+Plumbing.prototype.setTheme = function (theme) {
+ validate('O', [theme])
+ this.theme = theme
+}
+
+Plumbing.prototype.setTemplate = function (template) {
+ validate('A', [template])
+ this.template = template
+}
+
+Plumbing.prototype.setWidth = function (width) {
+ validate('N', [width])
+ this.width = width
+}
+
+Plumbing.prototype.hide = function () {
+ return consoleControl.gotoSOL() + consoleControl.eraseLine()
+}
+
+Plumbing.prototype.hideCursor = consoleControl.hideCursor
+
+Plumbing.prototype.showCursor = consoleControl.showCursor
+
+Plumbing.prototype.show = function (status) {
+ var values = Object.create(this.theme)
+ for (var key in status) {
+ values[key] = status[key]
+ }
+
+ return renderTemplate(this.width, this.template, values).trim() +
+ consoleControl.eraseLine() + consoleControl.gotoSOL()
+}