{"id":15361855,"url":"https://github.com/tj/node-term-list","last_synced_at":"2025-04-15T06:15:45.295Z","repository":{"id":9589033,"uuid":"11507081","full_name":"tj/node-term-list","owner":"tj","description":"Interactive terminal list for nodejs","archived":false,"fork":false,"pushed_at":"2014-01-01T20:05:07.000Z","size":145,"stargazers_count":125,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T16:51:24.602Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"rdp/virtual-audio-capture-grabber-device","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tj.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-18T15:57:28.000Z","updated_at":"2024-02-12T23:52:20.000Z","dependencies_parsed_at":"2022-08-26T08:50:58.952Z","dependency_job_id":null,"html_url":"https://github.com/tj/node-term-list","commit_stats":null,"previous_names":["visionmedia/node-term-list"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fnode-term-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fnode-term-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fnode-term-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj%2Fnode-term-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tj","download_url":"https://codeload.github.com/tj/node-term-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248767994,"owners_count":21158568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T12:56:55.646Z","updated_at":"2025-04-15T06:15:45.276Z","avatar_url":"https://github.com/tj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# term-list\n\n  Renders an interactive list to the terminal that users\n  can navigate using the arrow keys. Developers can bind\n  to \"keypress\" events to support removal or opening of items etc.\n\n  ![interactive terminal list](http://dsz91cxz97a03.cloudfront.net/YNqOchbrMD-150x150.png)\n\n## Installation\n\n```\n$ npm install term-list\n```\n\n## Example\n\n  A fully interactive list demonstrating removal via backspace,\n  and opening of the websites via the return key.\n\n```js\nvar List = require('term-list');\nvar exec = require('child_process').exec;\n\nvar list = new List({ marker: '\\033[36m› \\033[0m', markerLength: 2 });\nlist.add('http://google.com', 'Google');\nlist.add('http://yahoo.com', 'Yahoo');\nlist.add('http://cloudup.com', 'Cloudup');\nlist.add('http://github.com', 'Github');\nlist.start();\n\nlist.on('keypress', function(key, item){\n  switch (key.name) {\n    case 'return':\n      exec('open ' + item);\n      list.stop();\n      console.log('opening %s', item);\n      break;\n    case 'backspace':\n      list.remove(list.selected);\n      break;\n  }\n});\n\nlist.on('empty', function(){\n  list.stop();\n});\n```\n\n### API\n\n  - [List()](#list)\n  - [List.add()](#listaddidstringlabelstring)\n  - [List.remove()](#listremoveidstring)\n  - [List.at()](#listatinumber)\n  - [List.select()](#listselectidstring)\n  - [List.draw()](#listdraw)\n  - [List.up()](#listup)\n  - [List.down()](#listdown)\n  - [List.stop()](#liststop)\n  - [List.start()](#liststart)\n\n### List()\n\n  Initialize a new `List` with `opts`:\n  \n  - `marker` optional marker string defaulting to '› '\n  - `markerLength` optional marker length, otherwise marker.length is used\n\n### List.add(id:String, label:String)\n\n  Add item `id` with `label`.\n\n### List.remove(id:String)\n\n  Remove item `id`.\n\n### List.at(i:Number)\n\n  Return item at `i`.\n\n### List.select(id:String)\n\n  Select item `id`.\n\n### List.draw()\n\n  Re-draw the list.\n\n### List.up()\n\n  Select the previous item if any.\n\n### List.down()\n\n  Select the next item if any.\n\n### List.stop()\n\n  Reset state and stop the list.\n\n### List.start()\n\n  Start the list.\n\n## License\n\n  MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj%2Fnode-term-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftj%2Fnode-term-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj%2Fnode-term-list/lists"}