{
"_args": [
[
{
"raw": "gauge@~2.7.3",
"scope": null,
"escapedName": "gauge",
"name": "gauge",
"rawSpec": "~2.7.3",
"spec": ">=2.7.3 <2.8.0",
"type": "range"
},
"/Users/rdupaw/Development/rehabLinks/node_modules/npmlog"
]
],
"_from": "gauge@>=2.7.3 <2.8.0",
"_id": "gauge@2.7.4",
"_inCache": true,
"_location": "/gauge",
"_nodeVersion": "7.7.4",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/gauge-2.7.4.tgz_1492815975490_0.4050216095056385"
},
"_npmUser": {
"name": "iarna",
"email": "me@re-becca.org"
},
"_npmVersion": "4.5.0",
"_phantomChildren": {},
"_requested": {
"raw": "gauge@~2.7.3",
"scope": null,
"escapedName": "gauge",
"name": "gauge",
"rawSpec": "~2.7.3",
"spec": ">=2.7.3 <2.8.0",
"type": "range"
},
"_requiredBy": [
"/npmlog"
],
"_resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
"_shasum": "2c03405c7538c39d7eb37b317022e325fb018bf7",
"_shrinkwrap": null,
"_spec": "gauge@~2.7.3",
"_where": "/Users/rdupaw/Development/rehabLinks/node_modules/npmlog",
"author": {
"name": "Rebecca Turner",
"email": "me@re-becca.org"
},
"bugs": {
"url": "https://github.com/iarna/gauge/issues"
},
"dependencies": {
"aproba": "^1.0.3",
"console-control-strings": "^1.0.0",
"has-unicode": "^2.0.0",
"object-assign": "^4.1.0",
"signal-exit": "^3.0.0",
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1",
"wide-align": "^1.1.0"
},
"description": "A terminal based horizontal guage",
"devDependencies": {
"readable-stream": "^2.0.6",
"require-inject": "^1.4.0",
"standard": "^7.1.2",
"tap": "^5.7.2",
"through2": "^2.0.0"
},
"directories": {},
"dist": {
"shasum": "2c03405c7538c39d7eb37b317022e325fb018bf7",
"tarball": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz"
},
"files": [
"base-theme.js",
"CHANGELOG.md",
"error.js",
"has-color.js",
"index.js",
"LICENSE",
"package.json",
"plumbing.js",
"process.js",
"progress-bar.js",
"README.md",
"render-template.js",
"set-immediate.js",
"set-interval.js",
"spin.js",
"template-item.js",
"theme-set.js",
"themes.js",
"wide-truncate.js"
],
"gitHead": "1011abf6c2cb7ae89a3ee76fb447d3182d4e8d3a",
"homepage": "https://github.com/iarna/gauge",
"keywords": [
"progressbar",
"progress",
"gauge"
],
"license": "ISC",
"main": "index.js",
"maintainers": [
{
"name": "iarna",
"email": "me@re-becca.org"
}
],
"name": "gauge",
"optionalDependencies": {},
"readme": "gauge\n=====\n\nA nearly stateless terminal based horizontal gauge / progress bar.\n\n```javascript\nvar Gauge = require(\"gauge\")\n\nvar gauge = new Gauge()\n\ngauge.show(\"test\", 0.20)\n\ngauge.pulse(\"this\")\n\ngauge.hide()\n```\n\n![](gauge-demo.gif)\n\n\n### CHANGES FROM 1.x\n\nGauge 2.x is breaking release, please see the [changelog] for details on\nwhat's changed if you were previously a user of this module.\n\n[changelog]: CHANGELOG.md\n\n### THE GAUGE CLASS\n\nThis is the typical interface to the module– it provides a pretty\nfire-and-forget interface to displaying your status information.\n\n```\nvar Gauge = require(\"gauge\")\n\nvar gauge = new Gauge([stream], [options])\n```\n\n* **stream** – *(optional, default STDERR)* A stream that progress bar\n updates are to be written to. Gauge honors backpressure and will pause\n most writing if it is indicated.\n* **options** – *(optional)* An option object.\n\nConstructs a new gauge. Gauges are drawn on a single line, and are not drawn\nif **stream** isn't a tty and a tty isn't explicitly provided.\n\nIf **stream** is a terminal or if you pass in **tty** to **options** then we\nwill detect terminal resizes and redraw to fit. We do this by watching for\n`resize` events on the tty. (To work around a bug in verisons of Node prior\nto 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to\nlarger window sizes will be clean, but shrinking the window will always\nresult in some cruft.\n\n**IMPORTANT:** If you prevously were passing in a non-tty stream but you still\nwant output (for example, a stream wrapped by the `ansi` module) then you\nneed to pass in the **tty** option below, as `gauge` needs access to\nthe underlying tty in order to do things like terminal resizes and terminal\nwidth detection.\n\nThe **options** object can have the following properties, all of which are\noptional:\n\n* **updateInterval**: How often gauge updates should be drawn, in miliseconds.\n* **fixedFramerate**: Defaults to false on node 0.8, true on everything\n else. When this is true a timer is created to trigger once every\n `updateInterval` ms, when false, updates are printed as soon as they come\n in but updates more often than `updateInterval` are ignored. The reason\n 0.8 doesn't have this set to true is that it can't `unref` its timer and\n so it would stop your program from exiting– if you want to use this\n feature with 0.8 just make sure you call `gauge.disable()` before you\n expect your program to exit.\n* **themes**: A themeset to use when selecting the theme to use. Defaults\n to `gauge/themes`, see the [themes] documentation for details.\n* **theme**: Select a theme for use, it can be a:\n * Theme object, in which case the **themes** is not used.\n * The name of a theme, which will be looked up in the current *themes*\n object.\n * A configuration object with any of `hasUnicode`, `hasColor` or\n `platform` keys, which if wlll be used to override our guesses when making\n a default theme selection.\n\n If no theme is selected then a default is picked using a combination of our\n best guesses at your OS, color support and unicode support.\n* **template**: Describes what you want your gauge to look like. The\n default is what npm uses. Detailed [documentation] is later in this\n document.\n* **hideCursor**: Defaults to true. If true, then the cursor will be hidden\n while the gauge is displayed.\n* **tty**: The tty that you're ultimately writing to. Defaults to the same\n as **stream**. This is used for detecting the width of the terminal and\n resizes. The width used is `tty.columns - 1`. If no tty is available then\n a width of `79` is assumed.\n* **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true\n the gauge starts enabled. If disabled then all update commands are\n ignored and no gauge will be printed until you call `.enable()`.\n* **Plumbing**: The class to use to actually generate the gauge for\n printing. This defaults to `require('gauge/plumbing')` and ordinarly you\n shouldn't need to override this.\n* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit\n handler to make sure your cursor is turned back on and the progress bar\n erased when your process exits, even if you Ctrl-C out or otherwise exit\n unexpectedly. You can disable this and it won't register the exit handler.\n\n[has-unicode]: https://www.npmjs.com/package/has-unicode\n[themes]: #themes\n[documentation]: #templates\n\n#### `gauge.show(section | status, [completed])`\n\nThe first argument is either the section, the name of the current thing\ncontributing to progress, or an object with keys like **section**,\n**subsection** & **completed** (or any others you have types for in a custom\ntemplate). If you don't want to update or set any of these you can pass\n`null` and it will be ignored.\n\nThe second argument is the percent completed as a value between 0 and 1.\nWithout it, completion is just not updated. You'll also note that completion\ncan be passed in as part of a status object as the first argument. If both\nit and the completed argument are passed in, the completed argument wins.\n\n#### `gauge.hide([cb])`\n\nRemoves the gauge from the terminal. Optionally, callback `cb` after IO has\nhad an opportunity to happen (currently this just means after `setImmediate`\nhas called back.)\n\nIt turns out this is important when you're pausing the progress bar on one\nfilehandle and printing to another– otherwise (with a big enough print) node\ncan end up printing the \"end progress bar\" bits to the progress bar filehandle\nwhile other stuff is printing to another filehandle. These getting interleaved\ncan cause corruption in some terminals.\n\n#### `gauge.pulse([subsection])`\n\n* **subsection** – *(optional)* The specific thing that triggered this pulse\n\nSpins the spinner in the gauge to show output. If **subsection** is\nincluded then it will be combined with the last name passed to `gauge.show`.\n\n#### `gauge.disable()`\n\nHides the gauge and ignores further calls to `show` or `pulse`.\n\n#### `gauge.enable()`\n\nShows the gauge and resumes updating when `show` or `pulse` is called.\n\n#### `gauge.isEnabled()`\n\nReturns true if the gauge is enabled.\n\n#### `gauge.setThemeset(themes)`\n\nChange the themeset to select a theme from. The same as the `themes` option\nused in the constructor. The theme will be reselected from this themeset.\n\n#### `gauge.setTheme(theme)`\n\nChange the active theme, will be displayed with the next show or pulse. This can be:\n\n* Theme object, in which case the **themes** is not used.\n* The name of a theme, which will be looked up in the current *themes*\n object.\n* A configuration object with any of `hasUnicode`, `hasColor` or\n `platform` keys, which if wlll be used to override our guesses when making\n a default theme selection.\n\nIf no theme is selected then a default is picked using a combination of our\nbest guesses at your OS, color support and unicode support.\n\n#### `gauge.setTemplate(template)`\n\nChange the active template, will be displayed with the next show or pulse\n\n### Tracking Completion\n\nIf you have more than one thing going on that you want to track completion\nof, you may find the related [are-we-there-yet] helpful. It's `change`\nevent can be wired up to the `show` method to get a more traditional\nprogress bar interface.\n\n[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet\n\n### THEMES\n\n```\nvar themes = require('gauge/themes')\n\n// fetch the default color unicode theme for this platform\nvar ourTheme = themes({hasUnicode: true, hasColor: true})\n\n// fetch the default non-color unicode theme for osx\nvar ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'})\n\n// create a new theme based on the color ascii theme for this platform\n// that brackets the progress bar with arrows\nvar ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), {\n preProgressbar: '→',\n postProgressbar: '←'\n})\n```\n\nThe object returned by `gauge/themes` is an instance of the `ThemeSet` class.\n\n```\nvar ThemeSet = require('gauge/theme-set')\nvar themes = new ThemeSet()\n// or\nvar themes = require('gauge/themes')\nvar mythemes = themes.newThemeset() // creates a new themeset based on the default themes\n```\n\n#### themes(opts)\n#### themes.getDefault(opts)\n\nTheme objects are a function that fetches the default theme based on\nplatform, unicode and color support.\n\nOptions is an object with the following properties:\n\n* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is\n available then a non-unicode theme will be used.\n* **hasColor** - If true, fetch a color theme, if no color theme is\n available a non-color theme will be used.\n* **platform** (optional) - Defaults to `process.platform`. If no\n platform match is available then `fallback` is used instead.\n\nIf no compatible theme can be found then an error will be thrown with a\n`code` of `EMISSINGTHEME`.\n\n#### themes.addTheme(themeName, themeObj)\n#### themes.addTheme(themeName, [parentTheme], newTheme)\n\nAdds a named theme to the themeset. You can pass in either a theme object,\nas returned by `themes.newTheme` or the arguments you'd pass to\n`themes.newTheme`.\n\n#### themes.getThemeNames()\n\nReturn a list of all of the names of the themes in this themeset. Suitable\nfor use in `themes.getTheme(…)`.\n\n#### themes.getTheme(name)\n\nReturns the theme object from this theme set named `name`.\n\nIf `name` does not exist in this themeset an error will be thrown with\na `code` of `EMISSINGTHEME`.\n\n#### themes.setDefault([opts], themeName)\n\n`opts` is an object with the following properties.\n\n* **platform** - Defaults to `'fallback'`. If your theme is platform\n specific, specify that here with the platform from `process.platform`, eg,\n `win32`, `darwin`, etc.\n* **hasUnicode** - Defaults to `false`. If your theme uses unicode you\n should set this to true.\n* **hasColor** - Defaults to `false`. If your theme uses color you should\n set this to true.\n\n`themeName` is the name of the theme (as given to `addTheme`) to use for\nthis set of `opts`.\n\n#### themes.newTheme([parentTheme,] newTheme)\n\nCreate a new theme object based on `parentTheme`. If no `parentTheme` is\nprovided then a minimal parentTheme that defines functions for rendering the\nactivity indicator (spinner) and progress bar will be defined. (This\nfallback parent is defined in `gauge/base-theme`.)\n\nnewTheme should be a bare object– we'll start by discussing the properties\ndefined by the default themes:\n\n* **preProgressbar** - displayed prior to the progress bar, if the progress\n bar is displayed.\n* **postProgressbar** - displayed after the progress bar, if the progress bar\n is displayed.\n* **progressBarTheme** - The subtheme passed through to the progress bar\n renderer, it's an object with `complete` and `remaining` properties\n that are the strings you want repeated for those sections of the progress\n bar.\n* **activityIndicatorTheme** - The theme for the activity indicator (spinner),\n this can either be a string, in which each character is a different step, or\n an array of strings.\n* **preSubsection** - Displayed as a separator between the `section` and\n `subsection` when the latter is printed.\n\nMore generally, themes can have any value that would be a valid value when rendering\ntemplates. The properties in the theme are used when their name matches a type in\nthe template. Their values can be:\n\n* **strings & numbers** - They'll be included as is\n* **function (values, theme, width)** - Should return what you want in your output.\n *values* is an object with values provided via `gauge.show`,\n *theme* is the theme specific to this item (see below) or this theme object,\n and *width* is the number of characters wide your result should be.\n\nThere are a couple of special prefixes:\n\n* **pre** - Is shown prior to the property, if its displayed.\n* **post** - Is shown after the property, if its displayed.\n\nAnd one special suffix:\n\n* **Theme** - Its value is passed to a function-type item as the theme.\n\n#### themes.addToAllThemes(theme)\n\nThis *mixes-in* `theme` into all themes currently defined. It also adds it\nto the default parent theme for this themeset, so future themes added to\nthis themeset will get the values from `theme` by default.\n\n#### themes.newThemeset()\n\nCopy the current themeset into a new one. This allows you to easily inherit\none themeset from another.\n\n### TEMPLATES\n\nA template is an array of objects and strings that, after being evaluated,\nwill be turned into the gauge line. The default template is:\n\n```javascript\n[\n {type: 'progressbar', length: 20},\n {type: 'activityIndicator', kerning: 1, length: 1},\n {type: 'section', kerning: 1, default: ''},\n {type: 'subsection', kerning: 1, default: ''}\n]\n```\n\nThe various template elements can either be **plain strings**, in which case they will\nbe be included verbatum in the output, or objects with the following properties:\n\n* *type* can be any of the following plus any keys you pass into `gauge.show` plus\n any keys you have on a custom theme.\n * `section` – What big thing you're working on now.\n * `subsection` – What component of that thing is currently working.\n * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme`\n from your active theme.\n * `progressbar` – A progress bar representing your current `completed`\n using the `progressbarTheme` from your active theme.\n* *kerning* – Number of spaces that must be between this item and other\n items, if this item is displayed at all.\n* *maxLength* – The maximum length for this element. If its value is longer it\n will be truncated.\n* *minLength* – The minimum length for this element. If its value is shorter it\n will be padded according to the *align* value.\n* *align* – (Default: left) Possible values \"left\", \"right\" and \"center\". Works\n as you'd expect from word processors.\n* *length* – Provides a single value for both *minLength* and *maxLength*. If both\n *length* and *minLength or *maxLength* are specifed then the latter take precedence.\n* *value* – A literal value to use for this template item.\n* *default* – A default value to use for this template item if a value\n wasn't otherwise passed in.\n\n### PLUMBING\n\nThis is the super simple, assume nothing, do no magic internals used by gauge to\nimplement its ordinary interface.\n\n```\nvar Plumbing = require('gauge/plumbing')\nvar gauge = new Plumbing(theme, template, width)\n```\n\n* **theme**: The theme to use.\n* **template**: The template to use.\n* **width**: How wide your gauge should be\n\n#### `gauge.setTheme(theme)`\n\nChange the active theme.\n\n#### `gauge.setTemplate(template)`\n\nChange the active template.\n\n#### `gauge.setWidth(width)`\n\nChange the width to render at.\n\n#### `gauge.hide()`\n\nReturn the string necessary to hide the progress bar\n\n#### `gauge.hideCursor()`\n\nReturn a string to hide the cursor.\n\n#### `gauge.showCursor()`\n\nReturn a string to show the cursor.\n\n#### `gauge.show(status)`\n\nUsing `status` for values, render the provided template with the theme and return\na string that is suitable for printing to update the gauge.\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/iarna/gauge.git"
},
"scripts": {
"prepublish": "rm -f *~",
"test": "standard && tap test/*.js --coverage"
},
"version": "2.7.4"
}