JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q39240F
  • License MIT

A browser-friendly implementation of substack's terminal-menu

Package Exports

  • browser-menu

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (browser-menu) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

browser-menu Flattr this!experimental

A browser-friendly implementation of substack's terminal-menu module:

browser-menu

Usage

browser-menu

The API is more or less equivalent to terminal-menu:

Create a menu with opts:

  • opts.width - menu width in em
  • opts.x - top-left corner x offset, default: 1
  • opts.y - top-left corner y offset, default: 1
  • opts.fg - foreground color, default: 'white'
  • opts.bg - background color, default: 'blue'
  • opts.padding.left - left padding in em
  • opts.padding.right - right padding in em
  • opts.padding.top - top padding in em
  • opts.padding.bottom - bottom padding in em

The menu can be driven around with the arrow keys and j/k, vi-style. To quit out of the menu, hit ^C or q.

Create a new selectable menu item with the string label.

Write a message to the menu.

Adds the menu to the document. You can also do this yourself, as menu.element points to the DOM node for the menu.

Unregister all listeners and bring everything back to its original state.

License

MIT. See LICENSE.md for details.