From 410bd76ad3012276c894605f6ede3fa4ee7b5c9e Mon Sep 17 00:00:00 2001 From: Joshua Appelman Date: Sat, 30 Aug 2014 22:53:00 +0200 Subject: [PATCH] Linewraps at 80 where markdown syntax allows. --- readme.md | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/readme.md b/readme.md index 061f0d5..c8f6e32 100644 --- a/readme.md +++ b/readme.md @@ -5,7 +5,11 @@ [![Build Status](https://travis-ci.org/sindresorhus/chalk.svg?branch=master)](https://travis-ci.org/sindresorhus/chalk) ![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg) -[colors.js](https://github.com/Marak/colors.js) is currently the most popular string styling module, but it has serious deficiencies like extending String.prototype which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. +[colors.js](https://github.com/Marak/colors.js) is currently the most popular +string styling module, but it has serious deficiencies like extending +String.prototype which causes all kinds of +[problems](https://github.com/yeoman/yo/issues/68). Although there are other +ones, they either do too much or not enough. **Chalk is a clean and focused alternative.** @@ -33,7 +37,8 @@ $ npm install --save chalk ## Usage -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. +Chalk comes with an easy to use composable API where you just chain and nest +the styles you want. ```js var chalk = require('chalk'); @@ -65,7 +70,8 @@ var error = chalk.bold.red; console.log(error('Error!')); ``` -Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). +Take advantage of console.log [string +substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). ```js var name = 'Sindre'; @@ -80,7 +86,10 @@ console.log(chalk.green('Hello %s'), name); Example: `chalk.red.bold.underline('Hello', 'world');` -Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`. +Chain [styles](#styles) and call the last one as a method with a string +argument. Order doesn't matter, and later styles take precedent in case of a +conflict. This simply means that `Chalk.red.yellow.green` is equivalent to +`Chalk.green`. Multiple arguments will be separated by space. @@ -90,7 +99,8 @@ Color support is automatically detected, but you can override it. ### chalk.supportsColor -Detect whether the terminal [supports color](https://github.com/sindresorhus/supports-color). +Detect whether the terminal [supports +color](https://github.com/sindresorhus/supports-color). Can be overridden by the user with the flags `--color` and `--no-color`. @@ -98,9 +108,11 @@ Used internally and handled for you, but exposed for convenience. ### chalk.styles -Exposes the styles as [ANSI escape codes](https://github.com/sindresorhus/ansi-styles). +Exposes the styles as [ANSI escape +codes](https://github.com/sindresorhus/ansi-styles). -Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with yours. +Generally not useful, but you might need just the `.open` or `.close` escape +code if you're mixing externally styled strings with yours. ```js var chalk = require('chalk'); @@ -119,7 +131,8 @@ Check whether a string [has color](https://github.com/sindresorhus/has-ansi). [Strip color](https://github.com/sindresorhus/strip-ansi) from a string. -Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported. +Can be useful in combination with `.supportsColor` to strip color on externally +styled text when it's not supported. Example: