{"id":39645655,"url":"https://github.com/lcrespom/node-terminal-menu","last_synced_at":"2026-01-18T09:05:16.073Z","repository":{"id":57142882,"uuid":"234913105","full_name":"lcrespom/node-terminal-menu","owner":"lcrespom","description":"Simple menu widgets for the terminal","archived":false,"fork":false,"pushed_at":"2020-02-23T19:10:14.000Z","size":567,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T12:52:29.059Z","etag":null,"topics":["javascript","menu","node","shell","terminal"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lcrespom.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-01-19T14:27:14.000Z","updated_at":"2025-04-06T17:55:08.000Z","dependencies_parsed_at":"2022-09-05T22:30:17.199Z","dependency_job_id":null,"html_url":"https://github.com/lcrespom/node-terminal-menu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lcrespom/node-terminal-menu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcrespom%2Fnode-terminal-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcrespom%2Fnode-terminal-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcrespom%2Fnode-terminal-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcrespom%2Fnode-terminal-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lcrespom","download_url":"https://codeload.github.com/lcrespom/node-terminal-menu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcrespom%2Fnode-terminal-menu/sbom","scorecard":{"id":581211,"data":{"date":"2025-08-11","repo":{"name":"github.com/lcrespom/node-terminal-menu","commit":"2d7d070a354d0517ead72aa81c922da21f720ccf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T19:13:23.645Z","repository_id":57142882,"created_at":"2025-08-20T19:13:23.645Z","updated_at":"2025-08-20T19:13:23.645Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","menu","node","shell","terminal"],"created_at":"2026-01-18T09:05:15.976Z","updated_at":"2026-01-18T09:05:16.050Z","avatar_url":"https://github.com/lcrespom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-terminal-menu\nSimple menu widgets for the terminal, in JavaScript.\n\nTwo widgets are provided:\n- A vertical menu, using one line per item\n- A tabular menu, displaying items in a specified number of columns\n\nThe widgets expect keyboard events to be handled by the\n[keypress](https://github.com/TooTallNate/keypress) module, which must\nbe set up by the application. See the examples for more details.\n\n\n# Installation\nAs usual with node:\n```\nnpm install node-terminal-menu --save\n```\n\n# Examples\nSee the code examples in the `tests` directory. There are different example\nprograms with different level of complexity, illustrating all the different\nfeatures of the widgets.\n\n## Screenshot\nThe screenshot below is taken from the [Nash](https://github.com/lcrespom/nash)\nproject, which uses the table menu widget to let the user select files,\ndirectories and other elements.\n\n![Table menu](sample.png)\n\n# Usage\n\n## Vertical menu\n```\nconst { verticalMenu } = require('node-terminal-menu')\n\nlet menu = verticalMenu(config)\n```\n\n**Config object**:\n- **items**: required - an array of strings with the list of menu items to display.\n- **done**: required - a callback function that will be invoked when the user selects an item. The item index will be passed as a parameter to the callback.\n- **selection**: optional - the preselected menu item. Defaults to 0.\n- **height**: optional - maximum number of rows to display. If the height is smaller than the number of\n    items, scrolling is used (but no scroll bar is displayed).\n- **decorate**: optional - if present, this function will be invoked when displaying each menu item, e.g.\n    to colorize it. It receives two parameters: the menu item string and a boolean indicating whether\n    the item is selected or not, and returns the decorated menu item.\n    The default implementation renders unselected menu items without decoration and selected ones in reverse color.\n    Notice that menu items can be passed already decorated in the required **items** parameter, but this\n    property is useful in case the amount of items is large and the cost of decorating all of them before\n    opening the menu could keep the user waiting.\n\nThe call to `verticalMenu` returns a menu object with the following methods and properties:\n- **keyHandler**: a key event listener that can be used to listen to `keypress` events. That way, when the user presses arrow keys, the listener will update the menu selection accordingly, and when the user presses *return* or *escape*, the **done** callback will be invoked.\n- **update**: a method that receives a config object and updates the menu according to the new configuration.\n- **selection**: the current selection index.\n\n\n## Table menu\n```\nconst { tableMenu } = require('node-terminal-menu')\n\nlet menu = tableMenu(config)\n```\n\n**Config object**:\n- **items**: required - an array of strings with the list of menu items to display.\n- **done**: required - a callback function that will be invoked when the user selects an item. The item index will be passed as a parameter to the callback.\n- **columns**: required - the number of columns in the table.\n- **columnWidth**: required - the width of each column.\n- **selection**: optional - the preselected menu item. Defaults to 0.\n- **height**: optional - maximum number of rows to display. If the height is smaller than the number of\n    items, scrolling is used, and an optional scrollbar can be displayed using the **scrollBarCol** property.\n- **scrollBarCol**: optional - if this property is present and the **height** property is smaller than the\n    total number of rows, then a vertical scroll bar is displayed at the position indicated by the value of\n    this property.\n- **descs**: optional - an array of description strings, corresponding to each item. If present, the selected item\n    description will be displayed at the bottom of the table.\n- **descRows**: optional - maximum number of description lines. If not present, it is calculated by searching\n    inside the descriptions.\n- **colors**: optional - an object with function properties that, if present, will be invoked\n    to add terminal escape codes to give color to different parts of the menu.\n    - **item**: function to colorize each menu item.\n    - **selectedItem**: function to colorize the selected menu item\n    - **scrollArea**: function to colorize the vertical scroll area.\n    - **scrollBar**: function to colorize the scroll bar.\n    - **desc**: function to colorize the item's description, if present.\n\n\nThe call to `tableMenu` returns a menu object, with the same behavior as the call to `verticalMenu`.\n\n### Computing the table menu layout\n\nThe **columns** and **columnWidth** properties can be provided by the user, or can be computed via the `computeTableLayout` helper function:\n\n```\nlet { rows, columns, columnWidth } = computeTableLayout(items)\n```\n\nThe function takes the array of items and computes the number of rows, columns and their width based on the number of items and the width of the longest item. Apart from the items parameter, it supports two more optional parameters:\n- **gap**: the separation between columns - defaults to 2\n- **totalWidth**: the table width - defaults to the number of columns of the terminal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcrespom%2Fnode-terminal-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flcrespom%2Fnode-terminal-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcrespom%2Fnode-terminal-menu/lists"}