2022-01-21 08:28:41 +00:00
|
|
|
# picocolors
|
|
|
|
|
2022-05-29 09:24:36 +00:00
|
|
|
npm install picocolors
|
|
|
|
|
|
|
|
A tinier and faster alternative to [nanocolors](https://github.com/ai/nanocolors). Andrey, are you even trying?
|
2022-01-21 08:28:41 +00:00
|
|
|
|
|
|
|
```javascript
|
2022-05-29 09:24:36 +00:00
|
|
|
import pc from "picocolors";
|
2022-01-21 08:28:41 +00:00
|
|
|
|
2022-05-29 09:24:36 +00:00
|
|
|
console.log(pc.green(`How are ${pc.italic(`you`)} doing?`));
|
2022-01-21 08:28:41 +00:00
|
|
|
```
|
|
|
|
|
2022-05-29 09:24:36 +00:00
|
|
|
- Up to [2x faster and 2x smaller](#benchmarks) than alternatives
|
|
|
|
- 3x faster and 10x smaller than `chalk`
|
|
|
|
- [TypeScript](https://www.typescriptlang.org/) support
|
|
|
|
- [`NO_COLOR`](https://no-color.org/) friendly
|
|
|
|
- Node.js v6+ & browsers support
|
|
|
|
- The same API, but faster, much faster
|
|
|
|
- No `String.prototype` modifications (anyone still doing it?)
|
|
|
|
- No dependencies and the smallest `node_modules` footprint
|
2022-01-21 08:28:41 +00:00
|
|
|
|
|
|
|
## Docs
|
|
|
|
Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub.
|