{"_id":"cui","_rev":"43-e9ec1a4a81effdcf292e5ed1e90e86da","name":"cui","description":"GUIs for the command line","dist-tags":{"latest":"0.0.10"},"versions":{"0.0.1":{"name":"cui","description":"GUIs for the command line.","version":"0.0.1","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"dependencies":{"coffee-script":"1.3.3"},"bin":{"cui":"lib/cui.js"},"cui":"example/all","repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line tools are fast, but they can be hard to use. cui allows you to create optional (and potentially dynamic) views for each parameter your tool requires.\n\n## How\nViews are arranged in a sequence, and can display either buttons or fields. After each view collects input, the results are stored and the sequence advances. Views can include an action that executes after the results are stored, but before the sequence advances. Usually a tool's primary \"work\" is performed in the last view's action.\n\n## Install\n```npm install cui```\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing ```./all```\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require(\"cui\");\ncui.view({\n  title: \"This is a very basic example.\",\n  type: \"buttons\",\n  data: [\n    \"One\",\n    \"Two\",\n    \"Three\"\n  ],\n  action: function () {\n    console.log(\"You could do something now with: \\\"\" + cui.results[0] + \"\\\"\");\n  }\n});\n```\n","_id":"cui@0.0.1","dist":{"shasum":"0d1fb0566d6bf143a43d2f79188efd66d3e70456","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.1.tgz","integrity":"sha512-PYZ5cT4aS2wG0qhkDa1TSF1gr97vH1z4mzAfedxTic/iJkHGZfGBPiOr/XvZk7WY59w4zwXxjlZy2/skZvSbCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFqcq14FYIG+ns4SINPo5PS4jKKY0t9bP0oOei0FPd7HAiANr05HsEG5epBInqYeU4xBnkyRtX+ZhrdWGLR+ZIh3Rg=="}]},"_npmVersion":"1.1.61","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}],"directories":{}},"0.0.2":{"name":"cui","description":"GUIs for the command line.","version":"0.0.2","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"dependencies":{"coffee-script":"1.3.3"},"bin":{"cui":"lib/cui.js"},"cui":"example/all","repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line tools are fast, but they can be hard to use. cui allows you to create optional (and potentially dynamic) views for each parameter your tool requires.\n\n## How\nViews are arranged in a sequence, and can display either buttons or fields. After each view collects input, the results are stored and the sequence advances. Views can include an action that executes after the results are stored, but before the sequence advances. Usually a tool's primary \"work\" is performed in the last view's action.\n\n## Install\n```npm install cui```\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing ```./all```\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require(\"cui\");\ncui.view({\n  title: \"This is a very basic example.\",\n  type: \"buttons\",\n  data: [\n    \"One\",\n    \"Two\",\n    \"Three\"\n  ],\n  action: function () {\n    console.log(\"You could do something now with: \\\"\" + cui.results[0] + \"\\\"\");\n  }\n});\n```\n","_id":"cui@0.0.2","dist":{"shasum":"6aaa9f6e28a3dbb2a6c873dbb96292a5b3eaa305","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.2.tgz","integrity":"sha512-NFKWGZ1Z3V1sQea5ONtLI5e1YSTGloic+vbICzFfgHqp2y9E8NolK0wrneyK9BTlua9mjD/DHAQBPi1LTMkvzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE0gnuKWaNk9yzbdobPaaaqEDsty3yuHAPKVlx/vc6WrAiBEJb0y6dGdyI9mWAi0qPFAx82VmV5RwFAj9+1er02lXw=="}]},"_npmVersion":"1.1.61","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}],"directories":{}},"0.0.3":{"name":"cui","description":"GUIs for the command line.","version":"0.0.3","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"dependencies":{"coffee-script":"1.4.0"},"bin":{"cui":"lib/cui.js"},"cui":"example/all","repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line tools are fast, but they can be hard to use. cui allows you to create optional (and potentially dynamic) views for each parameter your tool requires.\n\n## How\nViews are arranged in a sequence, and can display either buttons or fields. After each view collects input, the results are stored and the sequence advances. Views can include an action that executes after the results are stored, but before the sequence advances. Usually a tool's primary \"work\" is performed in the last view's action.\n\n## Install\n```npm install cui```\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing ```./all```\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require(\"cui\");\ncui.view({\n  title: \"This is a very basic example.\",\n  type: \"buttons\",\n  data: [\n    \"One\",\n    \"Two\",\n    \"Three\"\n  ],\n  action: function () {\n    console.log(\"You could do something now with: \\\"\" + cui.results[0] + \"\\\"\");\n  }\n});\n```\n","_id":"cui@0.0.3","dist":{"shasum":"4a8099bbbd1dcd3903cde2e1257e93f63136f2fa","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.3.tgz","integrity":"sha512-8mgS0AiIBn0no2u5sqKpHIwIH/xO6x4SJAdJOGMSf+FZWPT9IbCvNttHyVVmqOvMFfqC5V7WKqGzIjRp8b4OgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRFpgD83LHG7MqEWi1tO00gPMPnJdH0NuhTQUoEE6VlgIgREbcwr/rXXopSa3pYHlaaTb2SLKKP2qpusD+u92oeWk="}]},"_npmVersion":"1.1.61","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}],"directories":{}},"0.0.4":{"name":"cui","description":"GUIs for the command line.","version":"0.0.4","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"dependencies":{"coffee-script":"1.4.0"},"bin":{"cui":"lib/cui.js"},"cui":"example/all","repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line tools are fast, but they can be hard to use. cui allows you to create optional (and potentially dynamic) views for each parameter your tool requires.\n\n## How\nViews are pushed to a sequence, and can display either buttons or fields. After each view collects input, the results are stored and the sequence advances. Views can include an action that executes after the results are stored, but before the sequence advances. Usually a tool's primary \"work\" is performed in the last view's action.\n\n## Install\n```npm install cui```\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing ```./all```\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require(\"cui\");\ncui.push({\n  title: \"This is a very basic example.\",\n  type: \"buttons\",\n  data: [\n    \"One\",\n    \"Two\",\n    \"Three\"\n  ],\n  action: function () {\n    console.log(\"You could do something now with: \\\"\" + cui.results[0] + \"\\\"\");\n  }\n});\n```\n","readmeFilename":"README.md","_id":"cui@0.0.4","dist":{"shasum":"6adc86c3edc2da489840160e050c54c2cc30b27e","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.4.tgz","integrity":"sha512-fUYMzZtGiBud+oBwdG+wugj+vGt+2LSX4iRPQKiCMdh0RK0aReGpo9AID8R9KaBJ3sOW2NQxJXI6sD+olKsGeQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxEEP2aCjFu/qjfeDxpqfIYAijIei3cuk502DFe9QEcgIgEHiuf/3niifHozW+b21avoahZVut6Nb9OAvWqZu8XBU="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}],"directories":{}},"0.0.5":{"name":"cui","description":"GUIs for the command line.","version":"0.0.5","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"dependencies":{"coffee-script":"1.4.0"},"bin":{"cui":"lib/cui.js"},"cui":"example/all","repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line tools are fast, but they can be hard to use. cui allows you to create optional (and potentially dynamic) views for each parameter your tool requires.\n\n## How\nViews are pushed to a sequence, and can display either buttons or fields. After each view collects input, the results are stored and the sequence advances. Views can include an action that executes after the results are stored, but before the sequence advances. Usually a tool's primary \"work\" is performed in the last view's action.\n\n## Install\n```npm install cui```\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing ```./all```\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require(\"cui\");\ncui.push({\n  title: \"This is a very basic example.\",\n  type: \"buttons\",\n  data: [\n    \"One\",\n    \"Two\",\n    \"Three\"\n  ],\n  action: function () {\n    console.log(\"You could do something now with: \\\"\" + cui.results[0] + \"\\\"\");\n  }\n});\n```\n\n## License\nMIT\n","readmeFilename":"README.md","_id":"cui@0.0.5","dist":{"shasum":"7566683706b0d6f7b5cdd4eaf9f39106a9343512","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.5.tgz","integrity":"sha512-mqSUWRatijj5M46dEV1f2d65SQ15IrN5x4tez9Seoz6H87sjWR6D/b7F//oZvaQXwpKo0eDbTka07U34TF34FA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7UOippMaqW+bI2wDGatwo4sqUVLHvGJggySzDv+vBagIgIaD+d7dZuph1mVDK2Bcr7sV4/MH1EdWi1ocGJcOCLXw="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}],"directories":{}},"0.0.6":{"name":"cui","description":"GUIs for the command line.","version":"0.0.6","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"bin":{"cui":"lib/cui.js"},"cui":"example/all","repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line tools are fast, but they can be hard to use. cui allows you to create optional (and potentially dynamic) views for each parameter your tool requires.\n\n## How\nViews are pushed to a sequence, and can display either buttons or fields. After each view collects input, the results are stored and the sequence advances. Views can include an action that executes after the results are stored, but before the sequence advances. Usually a tool's primary \"work\" is performed in the last view's action.\n\n## Install\n```npm install cui```\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing ```./all```\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require(\"cui\");\ncui.push({\n  title: \"This is a very basic example.\",\n  type: \"buttons\",\n  data: [\n    \"One\",\n    \"Two\",\n    \"Three\"\n  ],\n  action: function () {\n    console.log(\"You could do something now with: \\\"\" + cui.results[0] + \"\\\"\");\n  }\n});\n```\n\n## License\nMIT\n","readmeFilename":"README.md","_id":"cui@0.0.6","dist":{"shasum":"f8bc5609822cab37806025a3e0cf73ae61cc5664","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.6.tgz","integrity":"sha512-6Rq3NSQJlk9Z98Nwj/BHnChFKQUWm2NG1c+qshfdJNqpFr2rKqDmkw7hGHUISvXx23UysFUyDxYHULKHlP87lw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvJCzUpCuecubymhBszcf4yqwf8zuJAz4VXTJFaJR5SQIhANl3enrRVzMMLwAwKJgwU/yo4+hUZyp19kpsf7ECcdy1"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}],"directories":{}},"0.0.7":{"name":"cui","description":"GUIs for the command line.","version":"0.0.7","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"bin":{"cui":"lib/cui.js"},"cui":"example/all","repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line tools are fast, but they can be hard to learn/use. cui allows you to create optional (and potentially dynamic) views for each parameter your tool requires.\n\n## How\nViews are pushed to a sequence, and can display either buttons or fields. After each view collects input, the results are stored and the sequence advances. Views can include an action that executes after the results are stored, but before the sequence advances. Usually a tool's primary \"work\" is performed in the last view's action.\n\n## Install\n```npm install cui```\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing ```./all```\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require(\"cui\")\ncui.push({\n  title: \"This is a very basic example.\",\n  type: \"buttons\",\n  data: [\n    \"One\",\n    \"Two\",\n    \"Three\"\n  ],\n  action: function () {\n    console.log(\"You could do something now with: \\\"\" + cui.results[0] + \"\\\"\")\n  }\n})\n```\n\n## License\nMIT\n","readmeFilename":"README.md","_id":"cui@0.0.7","dist":{"shasum":"10b87f889acaf3ac3169fe88dd98428c496a4d28","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.7.tgz","integrity":"sha512-PlMHWJf91Uud7OAH+o6jAG0HgEfkjg+MDHicdePCdsWYD49hxFvTh5aNaGowb3ZifedMS/aOOrXspSn/OExUfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzq4CVX9P3jIbbQ1mWq5PHfnrdcrP/NLjMoD0wz5C+kAiEA0dDPIcTujcla6ihWNtzdgVR9I5vjbvptPZsPVRv+oxo="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}],"directories":{}},"0.0.8":{"name":"cui","description":"GUIs for the command line.","version":"0.0.8","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"bin":{"cui":"lib/cui.js"},"cui":"example/all","repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line tools are fast, but they can be hard to learn/use. cui allows you to create optional (and potentially dynamic) views for each parameter your tool requires.\n\n## How\nViews are pushed to a sequence, and can display either buttons or fields. After each view collects input, the results are stored and the sequence advances. Views can include an action that executes after the results are stored, but before the sequence advances. Usually a tool's primary \"work\" is performed in the last view's action.\n\n## Install\n```npm install cui```\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing ```./all```\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require(\"cui\")\ncui.push({\n  title: \"This is a very basic example.\",\n  type: \"buttons\",\n  data: [\n    \"One\",\n    \"Two\",\n    \"Three\"\n  ],\n  action: function () {\n    console.log(\"You could do something now with: \\\"\" + cui.results[0] + \"\\\"\")\n  }\n})\n```\n\n## License\nMIT\n","readmeFilename":"README.md","_id":"cui@0.0.8","dist":{"shasum":"8ca643ed5b0626d27c84d2d9f5120342e0f9d1ac","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.8.tgz","integrity":"sha512-0VkFVsjhgtJzP6IP9pMKVkCWt9XQ+jJ/nmV1SyE1Yy5MUkjdswAxQPc5mLUwoxfS/WYksamwjNWQSj0QgDqN5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw33nUZ5bw5ZqjsNk8DLeE0c1wbVzXF/oPS68IIM+b2QIgFGWWx7jdPI7Uxksxe8haMjf0LoIqaXWCvLxwjTdbBtg="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}],"directories":{}},"0.0.9":{"name":"cui","description":"GUIs for the command line","version":"0.0.9","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line programs can be hard to learn / use / build.\n\n## How\ncui is a preinstantiated object that can be `require()`'d by multiple files and maintain its state. Use `cui.push()` or `cui.splice()` to add views or actions (see the Usage section) to a sequence of frames. Users of your program only need to know the name of your program - cui can walk them through providing the rest of the arguments on its own. If a user *does* know the full command, they can still type it out of course, for example running the basic example any of the following ways is valid:  \n* `example/basic`  \n* `example/basic Three`  \n* `example/basic Three hi!`\n\n## Install\n`npm install cui`\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing `./all`\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require('cui')\n\ncui.push({\n  title: 'This is a very basic example.',\n  type: 'buttons',\n  data: [\n    'One',\n    'Two',\n    'Three'\n  ]\n})\n\ncui.push(function(cb) {\n\tif (cui.last(1) === 'Three') {\n\t  cui.splice({\n\t    title: 'Three is a special choice!',\n\t    type: 'fields',\n\t    data: 'Please type a word and press ENTER: '\n\t  })\n\t}\n\tcb()\n})\n\ncui.push(function(cb) {\n  console.log('You could do something now with: \"' + cui.results.join('\" and \"') + '\"')\n\tcb()\n})\n```\n\n## Properties\n* `args` any arguments passed\n* `results` an array of results collected by views or manually augmented by actions\n* `cache` a cache object that will be automatically loaded & saved if not null (as a json file named '.cui')\n\n## Methods\n* `push()` add a view or function to the end of the sequence\n* `splice()` add a view or function after the current frame\n* `last(n)` return `cui.results[results.length - n]`\n* `print()` basically `console.log()` but with the same indentation level as specified in `lib/ui`\n* `save()` persist the cache now - useful if your script may encounter future errors and exit early\n\n## License\nMIT\n","readmeFilename":"README.md","_id":"cui@0.0.9","dist":{"shasum":"7bc7e8201e2a7bc4ea3f074f898d90f5696cf163","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.9.tgz","integrity":"sha512-n0uoq4T5F7rHxRSiFLKs63XUNugtb5oF3WyT0gd63aeVDjdIV1kkAXBLCX0rSX4OjQ8Zb/qp3gL8D2xYYanNBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCu95Hv5IxB/sSPhIG09hfeHx6pm+XJnwlCQD8YAOpMAiEA9ZEZjzV2Mw9NI3Zv1IAgWmKMlhOjn3E95hHJPeo6Q5Q="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}]},"0.0.10":{"name":"cui","description":"GUIs for the command line","version":"0.0.10","main":"lib/cui.js","author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"repository":{"type":"git","url":"https://github.com/jessetane/cui.git"},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line programs can be hard to learn / use / build.\n\n## How\ncui is a preinstantiated object that can be `require()`'d by multiple files and maintain its state. Use `cui.push()` or `cui.splice()` to add views or actions (see the Usage section) to a sequence of frames. Users of your program only need to know the name of your program - cui can walk them through providing the rest of the arguments on its own. If a user *does* know the full command, they can still type it out of course, for example running the basic example any of the following ways is valid:  \n* `example/basic`  \n* `example/basic Three`  \n* `example/basic Three hi!`\n\n## Install\n`npm install cui`\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing `./all`\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require('cui')\n\ncui.push({\n  title: 'This is a very basic example.',\n  type: 'buttons',\n  data: [\n    'One',\n    'Two',\n    'Three'\n  ]\n})\n\ncui.push(function(cb) {\n\tif (cui.last(1) === 'Three') {\n\t  cui.splice({\n\t    title: 'Three is a special choice!',\n\t    type: 'fields',\n\t    data: 'Please type a word and press ENTER: '\n\t  })\n\t}\n\tcb()\n})\n\ncui.push(function(cb) {\n  console.log('You could do something now with: \"' + cui.results.join('\" and \"') + '\"')\n\tcb()\n})\n```\n\n## Properties\n* `args` any arguments passed\n* `results` an array of results collected by views or manually augmented by actions\n* `cache` a cache object that will be automatically loaded & saved if not null (as a json file named '.cui')\n\n## Methods\n* `push()` add a view or function to the end of the sequence\n* `splice()` add a view or function after the current frame\n* `last(n)` return `cui.results[results.length - n]`\n* `print()` basically `console.log()` but with the same indentation level as specified in `lib/ui`\n* `save()` persist the cache now - useful if your script may encounter future errors and exit early\n\n## License\nMIT\n","readmeFilename":"README.md","_id":"cui@0.0.10","dist":{"shasum":"8cf39fe9b92b908555f89d88d7550a967c9fe9ca","tarball":"https://registry.npmjs.org/cui/-/cui-0.0.10.tgz","integrity":"sha512-YWouMRP56iXpvTJP5dSSBn6Y+XVQbKAPTvh8jGIah5fci7vInoHz45vwQZ2YeX2I1gCANB67wIQ61NitxdyT6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFv3Me81L21F6BoSj3KzzxpOIeIAUowHIzcNAsFAVB4RAiEAhZqwXzcI90OF7Iew0fe0MQtWNcPD/Pk/knYwZJ8sG0g="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"jessetane","email":"jesse.tane@gmail.com"},"maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}]}},"readme":"```\n             .__ \n  ____  __ __|__|\n_/ ___\\|  |  \\  |\n\\  \\___|  |  /  |\n \\___  >____/|__|\n     \\/\n\n```\nGUIs for the command line.\n\n## Why\nCommand line tools are fast, but they can be hard to use. cui allows you to create optional (and potentially dynamic) views for each parameter your tool requires.\n\n## How\nViews are arranged in a sequence, and can display either buttons or fields. After each view collects input, the results are stored and the sequence advances. Views can include an action that executes after the results are stored, but before the sequence advances. Usually a tool's primary \"work\" is performed in the last view's action.\n\n## Install\n```npm install cui```\n\n## Examples\nThe examples are all executable scripts - try cd'ing into the example folder and typing ```./all```\n\n## Usage\nThis code below is essentially the same as in example/basic:\n```javascript\nvar cui = require(\"cui\");\ncui.view({\n  title: \"This is a very basic example.\",\n  type: \"buttons\",\n  data: [\n    \"One\",\n    \"Two\",\n    \"Three\"\n  ],\n  action: function () {\n    console.log(\"You could do something now with: \\\"\" + cui.results[0] + \"\\\"\");\n  }\n});\n```\n","maintainers":[{"name":"jessetane","email":"jesse.tane@gmail.com"}],"time":{"modified":"2022-06-14T05:47:38.160Z","created":"2012-10-22T01:44:20.290Z","0.0.1":"2012-10-22T01:44:20.729Z","0.0.2":"2012-10-22T01:45:13.994Z","0.0.3":"2012-11-05T06:26:34.476Z","0.0.4":"2012-11-18T00:42:29.836Z","0.0.5":"2012-11-28T23:32:55.754Z","0.0.6":"2012-12-01T02:13:27.265Z","0.0.7":"2012-12-05T20:54:12.452Z","0.0.8":"2012-12-21T03:42:42.505Z","0.0.9":"2013-01-14T18:45:51.659Z","0.0.10":"2013-01-22T15:52:06.411Z"},"author":{"name":"Jesse Tane","email":"jesse.tane@gmail.com"},"repository":{"type":"git","url":"https://github.com/jessetane/cui.git"}}