{"bugs":{"url":"https://github.com/oclif/cli-ux/issues"},"dist":{"shasum":"32ef9e6cb2b457be834280cc799028a11c8235a8","tarball":"https://registry.npmjs.org/cli-ux/-/cli-ux-5.6.7.tgz","fileCount":42,"integrity":"sha512-dsKAurMNyFDnO6X1TiiRNiVbL90XReLKcvIq4H777NMqXGBxBws23ag8ubCJE97vVZEgWG2eSUhsyLf63Jv8+g==","signatures":[{"sig":"MEUCIFtXiwVrHRdaMSjaALTIRW22JJE17R7UQxitpNESEEw5AiEAw0r5clEBoDC8z9xw+O5U0uPwHXf34R+j2ipgB54VLkk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuhu/CRA9TVsSAnZWagAAS88P/RHTxG4hv3uOzLNgS83B\nf5AlQ0pAFdR1UC9bn7IaxHH73TPA72lq3YL1iT1hXjZAgiyaVZQmD5LAVPZB\nQd2/3ZT2jl5a5VjUzGIeoTbqum5is2xJ+tujB0Nf3mc0fUK6gbWtrRuHWD7f\nyiYqSnWf8Y9F0Cc09Kid6zI2JHwwpwQFeEaomeJabAyW/weoPbgGfa7/tLOT\nPOu0vncxYF/+9gP2TITGHBZmrnbFOnV+h6aNt/DuyzLYLN29I9vAA2nkzMYI\nGdXIFOLcaD+R4HjnlhrrWlWSnKd0tpQxWH2HiEMGaDgUOmkxvRV2yh9V92GG\nlLkxxg67sAYrN2Afk4McGGUC44TGihHXVO+0iNePbIUvQVe40Lf6jmPCEHEK\n8RVLixyoQ0hG6cq0Yx2+HJFXZyxX+jNutW91soz4x2IxsiKl7m1gv3Ryahjm\na5cHRj/wpW3/fqV9eusgt33caYuuISYEPWPoQ44qe9pmZ9BsLJ557GvEJk/7\nm9Bi0LJMZeme4JL00bY0Lp9lmp1OxIfvj4wsdAmghbmMcMYShp2WMkrVKGoT\nzu4ZtNE88ZX0E7XvvOAeLlItuPu9Hb7UVDH/UkxpA9nl6Stv+rfApEcdABbr\n4GUZZwy28/PtqN4MBebKTE/RTJ52xkJLCvCpU8Zg+anjV20Id+4lJzHVxjxj\nh087\r\n=ouBL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"cli-ux","types":"lib/index.d.ts","author":{"name":"Jeff Dickey @jdxcode"},"readme":"cli-ux\n======\n\ncli IO utilities\n\n[![Version](https://img.shields.io/npm/v/cli-ux.svg)](https://npmjs.org/package/cli-ux)\n[![CircleCI](https://circleci.com/gh/oclif/cli-ux/tree/master.svg?style=svg)](https://circleci.com/gh/oclif/cli-ux/tree/master)\n[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/oclif/cli-ux?branch=master&svg=true)](https://ci.appveyor.com/project/heroku/cli-ux/branch/master)\n[![Known Vulnerabilities](https://snyk.io/test/npm/cli-ux/badge.svg)](https://snyk.io/test/npm/cli-ux)\n[![Downloads/week](https://img.shields.io/npm/dw/cli-ux.svg)](https://npmjs.org/package/cli-ux)\n[![License](https://img.shields.io/npm/l/cli-ux.svg)](https://github.com/oclif/cli-ux/blob/master/package.json)\n\n# Usage\n\nThe following assumes you have installed `cli-ux` to your project with `npm install cli-ux` or `yarn add cli-ux` and have it required in your script (TypeScript example):\n\n```typescript\nimport cli from 'cli-ux'\ncli.prompt('What is your name?')\n```\n\nJavaScript:\n\n```javascript\nconst {cli} = require('cli-ux')\n\ncli.prompt('What is your name?')\n```\n\n# cli.prompt()\n\nPrompt for user input.\n\n```typescript\n// just prompt for input\nawait cli.prompt('What is your name?')\n\n// mask input after enter is pressed\nawait cli.prompt('What is your two-factor token?', {type: 'mask'})\n\n// mask input on keypress (before enter is pressed)\nawait cli.prompt('What is your password?', {type: 'hide'})\n\n// yes/no confirmation\nawait cli.confirm('Continue?')\n\n// \"press any key to continue\"\nawait cli.anykey()\n```\n\n![prompt demo](assets/prompt.gif)\n\n# cli.url(text, uri)\n\nCreate a hyperlink (if supported in the terminal)\n\n```typescript\nawait cli.url('sometext', 'https://google.com')\n// shows sometext as a hyperlink in supported terminals\n// shows https://google.com in unsupported terminals\n```\n\n![url demo](assets/url.gif)\n\n# cli.open\n\nOpen a url in the browser\n\n```typescript\nawait cli.open('https://oclif.io')\n```\n\n# cli.action\n\nShows a spinner\n\n```typescript\n// start the spinner\ncli.action.start('starting a process')\n// show on stdout instead of stderr\ncli.action.start('starting a process', 'initializing', {stdout: true})\n\n// stop the spinner\ncli.action.stop() // shows 'starting a process... done'\ncli.action.stop('custom message') // shows 'starting a process... custom message'\n```\n\nThis degrades gracefully when not connected to a TTY. It queues up any writes to stdout/stderr so they are displayed above the spinner.\n\n![action demo](assets/action.gif)\n\n# cli.annotation\n\nShows an iterm annotation\n\n```typescript\ncli.annotation('sometext', 'annotated with this text')\n```\n\n![annotation demo](assets/annotation.png)\n\n# cli.wait\n\nWaits for 1 second or given milliseconds\n\n```typescript\nawait cli.wait()\nawait cli.wait(3000)\n```\n\n# cli.table\n\nDisplays tabular data\n\n```typescript\ncli.table(data, columns, options)\n```\n\nWhere:\n\n- `data`: array of data objects to display\n- `columns`: [Table.Columns](./src/styled/table.ts)\n- `options`: [Table.Options](./src/styled/table.ts)\n\n`cli.table.flags()` returns an object containing all the table flags to include in your command.\n\n```typescript\n{\n  columns: Flags.string({exclusive: ['additional'], description: 'only show provided columns (comma-separated)'}),\n  sort: Flags.string({description: 'property to sort by (prepend '-' for descending)'}),\n  filter: Flags.string({description: 'filter property by partial string matching, ex: name=foo'}),\n  csv: Flags.boolean({exclusive: ['no-truncate'], description: 'output is csv format'}),\n  extended: Flags.boolean({char: 'x', description: 'show extra columns'}),\n  'no-truncate': Flags.boolean({exclusive: ['csv'], description: 'do not truncate output to fit screen'}),\n  'no-header': Flags.boolean({exclusive: ['csv'], description: 'hide table header from output'}),\n}\n```\n\nPassing `{only: ['columns']}` or `{except: ['columns']}` as an argument into `cli.table.flags()` will allow/block those flags from the returned object.\n\n`Table.Columns` defines the table columns and their display options.\n\n```typescript\nconst columns: Table.Columns = {\n  // where `.name` is a property of a data object\n  name: {}, // \"Name\" inferred as the column header\n  id: {\n    header: 'ID', // override column header\n    minWidth: '10', // column must display at this width or greater\n    extended: true, // only display this column when the --extended flag is present\n    get: row => `US-O1-${row.id}`, // custom getter for data row object\n  },\n}\n```\n\n`Table.Options` defines the table options, most of which are the parsed flags from the user for display customization, all of which are optional.\n\n```typescript\nconst options: Table.Options = {\n  printLine: myLogger, // custom logger\n  columns: flags.columns,\n  sort: flags.sort,\n  filter: flags.filter,\n  csv: flags.csv,\n  extended: flags.extended,\n  'no-truncate': flags['no-truncate'],\n  'no-header': flags['no-header'],\n}\n```\n\nExample class:\n\n```typescript\nimport {Command} from '@oclif/command'\nimport {cli} from 'cli-ux'\nimport axios from 'axios'\n\nexport default class Users extends Command {\n  static flags = {\n    ...cli.table.flags()\n  }\n\n  async run() {\n    const {flags} = this.parse(Users)\n    const {data: users} = await axios.get('https://jsonplaceholder.typicode.com/users')\n\n    cli.table(users, {\n      name: {\n        minWidth: 7,\n      },\n      company: {\n        get: row => row.company && row.company.name\n      },\n      id: {\n        header: 'ID',\n        extended: true\n      }\n    }, {\n      printLine: this.log,\n      ...flags, // parsed flags\n    })\n  }\n}\n```\n\nDisplays:\n\n```shell\n$ example-cli users\nName                     Company\nLeanne Graham            Romaguera-Crona\nErvin Howell             Deckow-Crist\nClementine Bauch         Romaguera-Jacobson\nPatricia Lebsack         Robel-Corkery\nChelsey Dietrich         Keebler LLC\nMrs. Dennis Schulist     Considine-Lockman\nKurtis Weissnat          Johns Group\nNicholas Runolfsdottir V Abernathy Group\nGlenna Reichert          Yost and Sons\nClementina DuBuque       Hoeger LLC\n\n$ example-cli users --extended\nName                     Company            ID\nLeanne Graham            Romaguera-Crona    1\nErvin Howell             Deckow-Crist       2\nClementine Bauch         Romaguera-Jacobson 3\nPatricia Lebsack         Robel-Corkery      4\nChelsey Dietrich         Keebler LLC        5\nMrs. Dennis Schulist     Considine-Lockman  6\nKurtis Weissnat          Johns Group        7\nNicholas Runolfsdottir V Abernathy Group    8\nGlenna Reichert          Yost and Sons      9\nClementina DuBuque       Hoeger LLC         10\n\n$ example-cli users --columns=name\nName\nLeanne Graham\nErvin Howell\nClementine Bauch\nPatricia Lebsack\nChelsey Dietrich\nMrs. Dennis Schulist\nKurtis Weissnat\nNicholas Runolfsdottir V\nGlenna Reichert\nClementina DuBuque\n\n$ example-cli users --filter=\"company=Group\"\nName                     Company\nKurtis Weissnat          Johns Group\nNicholas Runolfsdottir V Abernathy Group\n\n$ example-cli users --sort=company\nName                     Company\nNicholas Runolfsdottir V Abernathy Group\nMrs. Dennis Schulist     Considine-Lockman\nErvin Howell             Deckow-Crist\nClementina DuBuque       Hoeger LLC\nKurtis Weissnat          Johns Group\nChelsey Dietrich         Keebler LLC\nPatricia Lebsack         Robel-Corkery\nLeanne Graham            Romaguera-Crona\nClementine Bauch         Romaguera-Jacobson\nGlenna Reichert          Yost and Sons\n```\n\n# cli.tree\n\nGenerate a tree and display it\n\n```typescript\nlet tree = cli.tree()\ntree.insert('foo')\ntree.insert('bar')\n\nlet subtree = cli.tree()\nsubtree.insert('qux')\ntree.nodes.bar.insert('baz', subtree)\n\ntree.display()\n```\n\nOutputs:\n```shell\n├─ foo\n└─ bar\n   └─ baz\n      └─ qux\n```\n\n# cli.progress\n\nGenerate a customizable progress bar and display it\n\n```typescript\nconst simpleBar = cli.progress()\nsimpleBar.start()\n\nconst customBar = cli.progress({\n                   format: 'PROGRESS | {bar} | {value}/{total} Files',\n                   barCompleteChar: '\\u2588',\n                   barIncompleteChar: '\\u2591',\n                 })\ncustomBar.start()\n```\n\nOutputs:\n```shell\nbar1:\nprogress [=====================-------------------] 53% | ETA: 1s | 53/100\nbar2:\nPROGRESS | █████████████████████████████░░░░░░░░░░░ | 146/204 Files\n```\n\nTo see a more detailed example, run \n```shell script\n$ ts-node examples/progress.ts\n```\n\nThis extends [cli-progress](https://www.npmjs.com/package/cli-progress)\nsee all of the options and customizations there, which can be passed in with the options object.\nOnly the single bar variant of cli-progress is currently supported.\n\n","engines":{"node":">=8.0.0"},"gitHead":"32b7d88d78e58baffb57003e779aae58a7ebe06b","license":"MIT","scripts":{"lint":"eslint . --ext .ts --config .eslintrc","test":"mocha --forbid-only \"test/**/*.test.ts\"","build":"rm -rf lib && tsc","pretest":"yarn build --noEmit && tsc -p test --noEmit","posttest":"yarn lint","prepublishOnly":"yarn run build"},"_npmUser":{"name":"salesforce-releases","email":"alm-cli@salesforce.com"},"homepage":"https://github.com/oclif/cli-ux","keywords":["oclif"],"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://github.com/oclif/cli-ux.git","type":"git"},"_npmVersion":"6.14.15","description":"cli IO utilities","directories":{},"maintainers":[{"name":"elbandito","email":"longoria.public@gmail.com"},{"name":"rasphilco","email":"philipe.navarro@salesforce.com"},{"name":"amphro","email":"amphro@gmail.com"},{"name":"anycli-bot","email":"jdxcode+anycli@gmail.com"},{"name":"salesforce-releases","email":"alm-cli@salesforce.com"},{"name":"rodesp","email":"rodesp@hey.com"},{"name":"dickeyxxx","email":"npm@jdxcode.com"}],"_nodeVersion":"12.22.7","dependencies":{"chalk":"^4.1.0","tslib":"^2.0.0","is-wsl":"^2.2.0","lodash":"^4.17.21","semver":"^7.3.2","js-yaml":"^3.13.1","cardinal":"^2.1.1","fs-extra":"^8.1","strip-ansi":"^6.0.0","ansi-styles":"^4.2.0","clean-stack":"^3.0.0","hyperlinker":"^1.0.0","ansi-escapes":"^4.3.0","cli-progress":"^3.4.0","string-width":"^4.2.0","@oclif/errors":"^1.3.5","@oclif/screen":"^1.0.4","extract-stack":"^2.0.0","indent-string":"^4.0.0","@oclif/command":"^1.8.15","object-treeify":"^1.1.4","supports-color":"^8.1.0","@oclif/linewrap":"^1.0.0","natural-orderby":"^2.0.1","password-prompt":"^1.1.2","supports-hyperlinks":"^2.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","axios":"^0.24.0","mocha":"^8.2.1","eslint":"^7.5.0","ts-node":"^9.0.0","fancy-test":"^1.4.1","typescript":"3.8.3","@types/chai":"^4.1.7","@types/node":"^11.11.2","@types/mocha":"^8.0.0","@oclif/config":"^1.18.2","@oclif/parser":"^3.8.6","@types/lodash":"^4.14.117","@types/semver":"^7.3.1","@types/js-yaml":"^3.12.1","@types/fs-extra":"^8.1","chai-as-promised":"^7.1.1","@types/strip-ansi":"^5.2.1","@types/ansi-styles":"^3.2.1","@types/clean-stack":"^2.1.1","eslint-config-oclif":"^3.1.0","@types/extract-stack":"^2.0.0","@types/supports-color":"^7.2.0","@types/chai-as-promised":"^7.1.0","eslint-config-oclif-typescript":"^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/cli-ux_5.6.7_1639586751186_0.08679007012296114","host":"s3://npm-registry-packages"},"_id":"cli-ux@5.6.7","version":"5.6.7"}