Skip to content
Create chalk style schemes with simpler style strings
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.npmrc
.travis.yml
LICENSE
README.md
example.js
index.js
package.json
screenshot.png
styles.js
test.js

README.md

chalk-pipe

Create chalk style schemes with simpler style strings

Install

$ npm install chalk-pipe

Usage

const chalkPipe = require('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

const chalk = require('chalk');
const chalkPipe = require('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:

const chalk = require('chalk');

chalk.enable = true;

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

Valid styles

Related

License

MIT © LitoMore

You can’t perform that action at this time.