Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terminal-kit

Package Overview
Dependencies
Maintainers
1
Versions
638
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terminal-kit

256 colors, keys and mouse, input field, progress bars, screen buffer (including 32-bit composition and image loading), text buffer, and many more... Whether you just need colors and styles, build a simple interactive command line tool or a complexe termi

  • 2.1.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
124K
decreased by-2.23%
Maintainers
1
Weekly downloads
 
Created

What is terminal-kit?

The terminal-kit npm package provides a comprehensive set of tools for creating rich terminal applications. It offers functionalities for handling terminal input and output, creating interactive user interfaces, and managing terminal capabilities.

What are terminal-kit's main functionalities?

Terminal Output

This feature allows you to output text to the terminal. The code sample demonstrates how to print 'Hello, world!' to the terminal using terminal-kit.

const term = require('terminal-kit').terminal;
term('Hello, world!\n');

Interactive Menus

This feature allows you to create interactive menus. The code sample shows how to create a single-column menu with three options and handle the user's selection.

const term = require('terminal-kit').terminal;
term.singleColumnMenu(['Option 1', 'Option 2', 'Option 3'], function(error, response) {
  term('
').eraseLineAfter.green('You selected: %s
', response.selectedText);
});

Text Input

This feature allows you to capture text input from the user. The code sample demonstrates how to prompt the user to enter their name and then display it.

const term = require('terminal-kit').terminal;
term('Enter your name: ');
term.inputField(function(error, input) {
  term.green('
Your name is: %s
', input);
});

Progress Bars

This feature allows you to create and manage progress bars. The code sample shows how to create a progress bar that updates every 100 milliseconds until it reaches 100%.

const term = require('terminal-kit').terminal;
const ProgressBar = require('terminal-kit').ProgressBar;
const progressBar = new ProgressBar({
  width: 80,
  title: 'Progress',
  eta: true,
  percent: true
});
let progress = 0;
const interval = setInterval(() => {
  progress += 0.01;
  progressBar.update(progress);
  if (progress >= 1) {
    clearInterval(interval);
    term.green('
Done!
');
  }
}, 100);

Other packages similar to terminal-kit

Keywords

FAQs

Package last updated on 14 Jul 2021

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