{"bugs":{"url":"https://github.com/oclif/cli-ux/issues"},"dist":{"shasum":"4823a8589995b14c7b0df3e90bc22bf4cedcfab0","tarball":"https://registry.npmjs.org/cli-ux/-/cli-ux-5.0.0-3.tgz","fileCount":42,"integrity":"sha512-PlcYDNCKtE9c1MCGor3+/6QziLFacgJ3zL1+nOTv4o85KWllWRY0e9doSY79PTU58huhzrYWlSe1CE0GyHLGwQ==","signatures":[{"sig":"MEUCIQDf77s/mwXQCc57aFnjm7JzrQzIVlQ3Fnag/qP16MDHywIgFANxM5Km0b0Bnk12nW74BX9lKJN7jwk9Vak0fbQGlCs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82462,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5dkBCRA9TVsSAnZWagAAetMP/2FFRcmSxX5esIyGaU6d\njpLUcE135ONq38LzqYwFNS5DrfpjRUH+V0dXsGQby4wwDxKtcJYs8vxO6pJe\nQBnAw/9JFqWrQ5gTQe4m7Rv/rzMPqtw+AgTSodr/+95yHiC8uvQAQ3+Wsvu7\nH2/vg0rE55fxdV5tp/ScozcvZjXWZw7+OyDA4hzI7Bm7WDVsFMAxkI1+82HE\nqs+Mv0+7IlzyNrPmCV9ZoyIqfWqaEg7/R8xG6H1PTIVDKBTCbpmvTsFUkXjm\nv7UbeuVCawwO4oD2O9aB8JLMPUWxJUWxlQpd8QoqC9FiJg1d3EA6oNUErNwN\nVpuwUqmWyKKRo9/2VaUzCE1GAMKpFX0/8f9g/tohbgZExlaciG6UrGDBUQeN\nIkY89nuwpBf1/JQHYdqDFua2xgBTR1g8tP10jHtSE31mc3HSy7sCRQ3UXqW2\nRzFXud8sjcwSg+Wa9oL0UrOODXXlZKxTgkKFIdOoqaqP/fyfocOy9QIkxP64\n3Wm9heKRw6heOhd58lO7CG6UorKIE3JdQ3IcVAt3AuNfsAg4ip4qScInO8RZ\ny7A1Z/3PWdBnoP0tyIprjEO0llBiY4CUiCwNWg3ma2vVo1ff2GLniui2rJps\ngDbSY1C+RKaPyiEY/N9MUllw9M43mGLvpYdLboD2hgZDVKHs89G2LHV00u1I\nJ1Yi\r\n=TEsp\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[![Codecov](https://codecov.io/gh/oclif/cli-ux/branch/master/graph/badge.svg)](https://codecov.io/gh/oclif/cli-ux)\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', {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\n// start the spinner\ncli.annotation('sometest', '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` is an object containing all the flags to include in your command class.\n\n```typescript\n{\n  columns: Flags.string({exclusive: ['additional'], description: 'only show provided columns (comma-seperated)'}),\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  extra: Flags.boolean({char: 'x', description: 'show all 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\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    extra: true, // only display this column when the --extra 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  extra: flags.extra,\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        extra: 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   Team\nJordan Sales\nJamie  Engineering\n\n$ example-cli users --extra\nName   Team        ID\nJordan Sales       100\nJamie  Engineering 200\n\n$ example-cli users --columns=name\nName\nJordan\nJamie\n\n$ example-cli users --filter=\"team=sales\"\nName   Team        ID\nJordan Sales       100\n\n$ example-cli users --sort=team\nName   Team        ID\nJamie  Engineering 200\nJordan Sales       100\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","engines":{"node":">=8.0.0"},"license":"MIT","scripts":{"lint":"tsc -p test --noEmit && tslint -p test -t stylish","test":"mocha --forbid-only \"test/**/*.test.ts\"","build":"rm -rf lib && tsc","posttest":"yarn run lint","prepublishOnly":"yarn run build"},"_npmUser":{"name":"rasphilco","email":"philipe@heroku.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":"https://github.com/oclif/cli-ux.git","type":"git"},"description":"cli IO utilities","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2018 Salesforce.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","maintainers":[{"name":"anycli-bot","email":"jdxcode+anycli@gmail.com"},{"name":"dhaulagiri","email":"brian.runnells+github@gmail.com"},{"name":"dickeyxxx","email":"dickeytk+npm@gmail.com"},{"name":"elbandito","email":"longoria.public@gmail.com"},{"name":"oclif-bot","email":"jdxcode+oclif@gmail.com"},{"name":"ransombriggs","email":"rbriggs@heroku.com"},{"name":"rasphilco","email":"philipe@heroku.com"}],"dependencies":{"chalk":"^2.4.1","is-wsl":"^1.1.0","lodash":"^4.17.11","semver":"^5.6.0","treeify":"^1.1.0","cardinal":"^2.1.1","fs-extra":"^7.0.0","strip-ansi":"^5.0.0","ansi-styles":"^3.2.1","clean-stack":"^1.3.0","hyperlinker":"^1.0.0","ansi-escapes":"^3.1.0","string-width":"^2.1.1","@oclif/errors":"^1.2.1","@oclif/screen":"^1.0.3","extract-stack":"^1.0.0","indent-string":"^3.2.0","@oclif/command":"^1.5.1","supports-color":"^5.5.0","@oclif/linewrap":"^1.0.0","natural-orderby":"^1.0.2","password-prompt":"^1.0.7","supports-hyperlinks":"^1.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","axios":"^0.18.0","mocha":"^5.2.0","eslint":"^5.7.0","tslint":"^5.11.0","ts-node":"^7.0.1","fancy-test":"^1.4.1","typescript":"^3.1.3","@types/chai":"^4.1.6","@types/node":"^10.11.7","@types/mocha":"^5.2.5","@oclif/config":"^1.7.4","@oclif/parser":"^3.7.0","@oclif/tslint":"^3.1.0","@types/lodash":"^4.14.117","@types/semver":"^5.5.0","@types/fs-extra":"^5.0.4","chai-as-promised":"^7.1.1","@types/strip-ansi":"^3.0.0","@types/ansi-styles":"^3.2.0","@types/clean-stack":"^1.3.0","eslint-config-oclif":"^3.1.0","@types/extract-stack":"^1.0.0","@types/indent-string":"^3.0.0","@types/supports-color":"^5.3.0","@types/chai-as-promised":"^7.1.0"},"_npmOperationalInternal":{"tmp":"tmp/cli-ux_5.0.0-3_1541789952999_0.6290065419661302","host":"s3://npm-registry-packages"},"_id":"cli-ux@5.0.0-3","version":"5.0.0-3"}