1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-29 02:29:06 -05:00
denoland-deno/colors/README.md

32 lines
901 B
Markdown
Raw Normal View History

2018-12-18 23:30:44 -05:00
# colors
2019-01-03 23:13:21 -05:00
Is a basic console color module intended for [Deno](https://deno.land/). It is
2019-01-19 05:09:35 -05:00
inspired by [chalk](https://www.npmjs.com/package/chalk),
[kleur](https://www.npmjs.com/package/kleur), and
2018-12-18 23:30:44 -05:00
[colors](https://www.npmjs.com/package/colors) on npm.
## Usage
2019-01-19 05:09:35 -05:00
The main modules exports several functions which can color the output to the
console:
2018-12-18 23:30:44 -05:00
```ts
import { bgBlue, red, bold } from "https://deno.land/std/colors/mod.ts";
2018-12-18 23:30:44 -05:00
2019-01-19 05:09:35 -05:00
console.log(bgBlue(red(bold("Hello world!"))));
2018-12-18 23:30:44 -05:00
```
This module supports `NO_COLOR` environmental variable disabling any coloring if `NO_COLOR` is set.
2018-12-18 23:30:44 -05:00
## TODO
- Currently, it just assumes it is running in an environment that supports ANSI
2018-12-24 10:28:01 -05:00
escape code terminal coloring. It should actually detect, specifically windows
and adjust properly.
2018-12-18 23:30:44 -05:00
- Test coverage is very basic at the moment.
---
2019-01-02 09:56:17 -05:00
Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.