Skip to content

Commit

Permalink
docs: add chalk to preferred manifest (#188)
Browse files Browse the repository at this point in the history
Adds `chalk` and `cli-color` to the preferred manifest and documents alternatives.

Closes #149

---------

Co-authored-by: Superchupu <[email protected]>
Co-authored-by: Ben McCann <[email protected]>
  • Loading branch information
3 people authored Dec 8, 2024
1 parent 5560f17 commit 4d372d0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ESLint plugin.
- [`body-parser`](./body-parser.md)
- [`buf-compare`](./buf-compare.md)
- [`buffer-equal` / `buffer-equals`](./buffer-equal.md)
- [`chalk`](./chalk.md)
- [`cpx`](./cpx.md)
- [`deep-equal`](./deep-equal.md)
- [`dotenv`](./dotenv.md)
Expand Down
35 changes: 35 additions & 0 deletions docs/modules/chalk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# chalk

`chalk`, `cli-color`, and similar libraries have various alternatives which are lighter and faster.

# Alternatives

## picocolors

A widely used alternative which is much lighter and faster.

[Project Page](https://github.com/alexeyraspopov/picocolors)

[npm](https://npmjs.com/package/picocolors)

## ansis

A lighter alternative which also supports 256 color creation.

[Project Page](https://github.com/webdiscus/ansis)

[npm](https://npmjs.com/package/ansis)

## styleText (Node 20.x and above)

Node itself has a `styleText` function in the built-in `util` library.

You can use it like so:

```js
import { styleText } from 'node:util';

styleText('green', 'Success!')
```

[Project Page](https://nodejs.org/api/util.html#utilstyletextformat-text-options)
12 changes: 12 additions & 0 deletions manifests/preferred.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
"docPath": "is-builtin-module",
"category": "preferred"
},
{
"type": "documented",
"moduleName": "chalk",
"docPath": "chalk",
"category": "preferred"
},
{
"type": "documented",
"moduleName": "cli-color",
"docPath": "chalk",
"category": "preferred"
},
{
"type": "documented",
"moduleName": "cpx",
Expand Down

0 comments on commit 4d372d0

Please sign in to comment.