{"bugs":{"url":"https://github.com/oclif/cli-ux/issues"},"dist":{"shasum":"5461dffb6c29e4a727e071f8b74bbebcc6b7be08","tarball":"https://registry.npmjs.org/cli-ux/-/cli-ux-6.0.5.tgz","fileCount":42,"integrity":"sha512-q2pvzDiXMNISMqCBh0P2dkofQ/8OiWlEAjl6MDNk5oUZ6p54Fnk1rOaXxohYm+YkLX5YNUonGOrwkvuiwVreIg==","signatures":[{"sig":"MEUCIBC+8O5QjeYC4IlzR4B87QDce4QMvdkeqNBh6eSZhYyrAiEAsHLEoTpl51oJZs7F1fic1utfyZ5IyWo2Ftcl5yVoasI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":99717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhr7F3CRA9TVsSAnZWagAAKH8P/1A/EpPcNr41muPkHfLw\nxD0JH4H97GMeYbXIVEz55Uh0WHEcpeO2054cWtPerLrjVweTyWf1GQZtwtVI\nIAxakpRRXDhuT4gUTTDmJmZgZenFz+VlCNGEJDQHZttcPTe5SAymHBhDx9Fm\n4XU7T9XHYiTcWga40Gzi48h8jeIvVhneBHzDbsUlsxFyMHAYrMUmOMjryRtZ\neVisBDCauyhy0e04fcTU0kHcT0B9ez4IJ85mZ1XkyXGDlXt0HBSGw1uaSSv1\nv8EAa7vHhnIeN66vIKSdxlFWgPLA0fPUjIQs3QPzs09uQeYMD8MPF1FRPGkm\ngzbUg2qr3BmJ2CNmiT8O2FpR4p1h+HdIhIyJYJ9TtASuM8kgdBnvrCU4AgNz\nJlRzZVkTvH5Cwmd/iZFvQjLcSFpxi0v8CdFJ/Hd2zepYk7VQsRzIZP2yZ8Gu\nWMCQ6dRJ/01RBGRNC9WtKGTaTUVyTpOePlO1M4Vr80mF8sLPav2qoK5BehVE\n5UEcr8SDm3pFnpk3xcLVxWe173Wl1+ZBTtMxVZDnCZUeRgSEc4DkEeBe3djB\nYO5nVqYbT6n9TBVIf1tkrwGyTKYPzcyzHhd3Sum+Kq/HHesdxXMfxTJraXUC\n5iNiaMU0VVHoJcapKbBngdV7bgzzgW1p53RNQGbk8Y9G6iLj6YBUioDdW2pO\nO6eC\r\n=JxSz\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/core'\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":">=12.0.0"},"gitHead":"256325e7db263237230685fed95928c413295445","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","@oclif/core":"^1.0.8","ansi-styles":"^4.2.0","clean-stack":"^3.0.0","hyperlinker":"^1.0.0","ansi-escapes":"^4.3.0","cli-progress":"^3.9.1","string-width":"^4.2.0","@oclif/screen":"^1.0.4 ","extract-stack":"^2.0.0","indent-string":"^4.0.0","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.21.0","mocha":"^9.1.3","eslint":"^7.32.0","ts-node":"^9.0.0","fancy-test":"^1.4.10","typescript":"4.4.3","@types/chai":"^4.1.7","@types/node":"^11.11.2","@types/mocha":"^8.0.0","@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":"^4.0.0","@types/extract-stack":"^2.0.0","@types/supports-color":"^7.2.0","@types/chai-as-promised":"^7.1.0","eslint-config-oclif-typescript":"^1.0.2"},"_npmOperationalInternal":{"tmp":"tmp/cli-ux_6.0.5_1638904183796_0.2641474643346975","host":"s3://npm-registry-packages"},"_id":"cli-ux@6.0.5","version":"6.0.5"}