New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

terminal-i2

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terminal-i2

With this module you can create interactive menus in your terminal. Use the `createMenu` class provided by the module for this. This is a first version and we will add other functionalities.

  • 2.0.0-beta-1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
75
decreased by-10.71%
Maintainers
0
Weekly downloads
 
Created
Source

Terminal i2

Description

With this module you can create interactive menus in your terminal. Use the createMenu class provided by the module for this. This is a first version and we will add other functionalities.

Installation

npm install terminal-i2
pnpm install terminal-i2

Examples

We have added some examples that you can find in our repository, inside the src/scripts folder

Usage

  • Type of options menu

    • title: Title of the menu
    • options: Different options that the menu will have
    • markedOption: default option marked
    • colorTitle: color of the title
    • colorOption: color of the options
    • bgColorOption: color of the background of the options
    • colorOptionHover: color of the options when the selector is over
    • bgColorOptionHover: color of the background of the options when the selector is over
  • Type of options dialog

    • title: Title of the dialog
    • description: The message you want to display in the dialog
  • Example 1

    import { createMenu } from 'terminal-i2';
    const menu = createMenu({
        colorTitle: 'red',
        bgColorOption: '',
        colorOption: 'white',
        bgColorOptionHover: 'bgYellow',
        colorOptionHover: 'red',
    });
    const option = await menu
        .head(`[white]Titulo del menu[/white]`)
        .item("Opción 1", true)
        .item("Opción 2")
        .item("Opción 3")
        .render()
  • Example 2
    import { createMenu } from 'terminal-i2';
    const menu = createMenu({
        colorTitle: 'red',
        bgColorOption: '',
        colorOption: 'white',
        bgColorOptionHover: 'bgYellow',
        colorOptionHover: 'red',
        title: 'Titulo del menu',
        options: ['Opción 1', 'Opción 2', 'Opción 3'],
        markedOption: 1
    });
    const option = await menu.render()
  • Example 3
    import { createDialog } from 'terminal-i2';
    const dialog = createDialog({
        title:"Saludo",
        description:`Hola mundo! en especial a Octavio`
    })
    const { key, label, onAction } = await dialog.render()

FAQs

Package last updated on 05 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc