Code Monkey home page Code Monkey logo

ink-color-pipe's Introduction

ink-color-pipe

chalk-pipe component for Ink 3

Create color text with simpler style strings in Ink

For Ink 2, check [email protected]

Install

$ npm i ink-color-pipe

Usage

This brings you a convenient way to use some color schemes.

import React from 'react';
import {render, Text} from 'ink';
import Color from 'ink-color-pipe';

const link = 'blue.underline';
const error = 'bgRed.white';

render(
	<Text>
		<Color styles={link}>Unicorn</Color>
		<Color styles={error}>{' Error '}</Color>
	</Text>
);

API

<Color>

<Color> is using <Transform> for text rendering.

styles

Type: string

Use dot . to separeate multiple styles.

Valid Styles

Related

  • chalk-pipe - Create chalk style schemes with simpler style strings

License

MIT ยฉ LitoMore

ink-color-pipe's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ink-color-pipe's Issues

Error: Cannot find module 'chalk-pipe'

I'm trying to add color using this library. I'm getting below error.
Anybody getting this issue?
Step to reproduce:

  1. Clone the repository
  2. npm i
  3. add "module": "CommonJS" in tsconfig
  4. npm run demo

ink-color-pipe-main\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
throw ex;
^

Error: Cannot find module 'chalk-pipe'
Require stack:

  • ink-color-pipe-main\dist\source\index.js
  • ink-color-pipe-main\dist\example\index.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.