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

just-ansi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-ansi

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

JustAnsi version

Simple and fast ANSI control code processing.

  • Gem: rubygems.org
  • Source: github.com
  • Help: rubydoc.info

Description

JustAnsi provides a rich set of methods to generate ANSI control codes for attributes, colors, cursor movement and much more. It supports most control codes, all attributes, 3/4bit-, 8bit- and 24bit-colors.

hello = JustAnsi.decorate('Hello World!', :bold, :red)
# => "\e[1;31mHello World!\e[m"

JustAnsi.undecorate(hello)
# => 'Hello World!'

JustAnsi.bbcode('[b]Hello [red]World[/fg]![/b]')
# => "\e[1mHello \e[31mWorld\e[39m!\e[22m"

Help

📕 See the online help and have a look at the examples directory.

Run Examples

You can execute the examples by

ruby ./examples/bbcode.rb

Installation

You can install the gem in your system with

gem install just-ansi

or you can use Bundler to add JustAnsi to your own project:

bundle add just-ansi

After that you only need one line of code to have everything together

require 'just-ansi'

FAQs

Package last updated on 05 Oct 2024

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