chalk-pipe
Create chalk style schemes with simpler style strings
Last updated 5 years ago by litomore .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install chalk-pipe 
SYNC missed versions from official npm registry.

chalk-pipe

Create chalk style schemes with simpler style strings

Install

$ npm install chalk-pipe

Usage

import chalkPipe from 'chalk-pipe';

console.log(chalkPipe('blue.bold')('Hello world!'));

Use dot . to separeate multiple styles:

const link = chalkPipe('blue.underline');
const error = chalkPipe('bgRed.#cccccc');
const warning = chalkPipe('orange.bold');

console.log(link('Link!'));
console.log(error('Error!'));
console.log(warning('Warning!'));

chalkPipe is also chalk:

const blue = chalkPipe('blue');
const link = blue.underline;

console.log(link('Link!'));

Use custom chalk

import chalk from 'chalk';
import chalkPipe from 'chalk-pipe';

const text =  chalkPipe('underline', chalk.blue)('Link!');

console.log(text);

API

chalkPipe(styles)(text)

Example:

chalkPipe('blue.underline')('Link!');

chalkPipe(styles, chalk)(text)

Example:

import chalk from 'chalk';

chalk.enable = true;

chalkPipe('underline', chalk.blue)('Link!');

Valid styles

Related

License

MIT © LitoMore

Current Tags

  • 5.1.1                                ...           latest (5 years ago)

10 Versions

  • 5.1.1                                ...           5 years ago
  • 5.1.0                                ...           5 years ago
  • 5.0.0                                ...           5 years ago
  • 4.0.0                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.0                                ...           8 years ago
  • 1.3.0                                ...           8 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |