Socket
Book a DemoInstallSign in
Socket

@nxmix/tokenize-ansi

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nxmix/tokenize-ansi

tokenize a string that includes ansi code

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
3
Created
Source

tokenize-ansi

styled with prettier Build Status Coverage Status npm Greenkeeper badge

tokenize a string that includes ansi code.

Usage

install

npm install @nxmix/tokenize-ansi

example

import tokenize from '@nxmix/tokenize-ansi'

tokenize("\x1b1A");
// => [ ["up", 1] ], cursor moves up one line

tokenize("\x1b31m" + "a");
// => [ ["red"], ["text", "a"] ], red text

tokenize("\x1b38;2;123,45,67m" + "a");
// => [ ["moreColor", 2, 123, 45, 67], ["text", "a"] ], true-color text

tokenize("\x1b25h");
// => [ ["cursor-on"] ], show cursor

This project follows the all-contributors specification. Contributions of any kind are welcome!

Keywords

ansi

FAQs

Package last updated on 14 Jun 2018

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