Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Oct 5, 2022
1 parent c231162 commit 96f44c9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -10,12 +10,13 @@ jobs:
fail-fast: false
matrix:
node-version:
- 18
- 16
- 14
- 12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
7 changes: 5 additions & 2 deletions package.json
Expand Up @@ -58,12 +58,15 @@
"log-update": "^5.0.0",
"matcha": "^0.7.0",
"tsd": "^0.19.0",
"xo": "^0.47.0",
"xo": "^0.52.4",
"yoctodelay": "^2.0.0"
},
"xo": {
"rules": {
"unicorn/prefer-string-slice": "off"
"unicorn/prefer-string-slice": "off",
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/consistent-type-exports": "off",
"@typescript-eslint/consistent-type-definitions": "off"
}
},
"c8": {
Expand Down
25 changes: 14 additions & 11 deletions readme.md
Expand Up @@ -13,7 +13,6 @@
[![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents)
[![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk)
[![run on repl.it](https://img.shields.io/badge/Run_on_Replit-130f26?logo=replit&logoColor=white)](https://repl.it/github/chalk/chalk)
[![Support Chalk on DEV](https://badge.devprotocol.xyz/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15/descriptive)](https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15)

![](media/screenshot.png)

Expand All @@ -25,19 +24,19 @@
<p>
<p>
<sup>
Sindre Sorhus' open source work is supported by the community on <a href="https://github.com/sponsors/sindresorhus">GitHub Sponsors</a> and <a href="https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15">Dev</a>
Sindre Sorhus' open source work is supported by the community on <a href="https://github.com/sponsors/sindresorhus">GitHub Sponsors</a>
</sup>
</p>
<sup>Special thanks to:</sup>
<br>
<br>
<a href="https://standardresume.co/tech">
<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="160"/>
<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="160">
</a>
<br>
<br>
<a href="https://retool.com/?utm_campaign=sindresorhus">
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230"/>
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230">
</a>
<br>
<br>
Expand All @@ -62,6 +61,16 @@
<sup>It’s 100% JavaScript, fully customizable, and developer-first.</sup>
</div>
</a>
<br>
<br>
<a href="https://www.stackaid.us/?utm_campaign=sindre">
<div>
<img src="https://sindresorhus.com/assets/thanks/stackaid-logo.png" width="230" alt="StackAid">
</div>
<b>Fund your open source dependencies</b>
</a>
<br>
<br>
</p>
</div>

Expand All @@ -80,7 +89,7 @@
- Doesn't extend `String.prototype`
- Clean and focused
- Actively maintained
- [Used by ~76,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 26, 2021
- [Used by ~86,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 4, 2022

## Install

Expand Down Expand Up @@ -288,12 +297,6 @@ If you're on Windows, do yourself a favor and use [Windows Terminal](https://git

[colors.js](https://github.com/Marak/colors.js) used to be 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) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.

## chalk for enterprise

Available as part of the Tidelift Subscription.

The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

## Related

- [chalk-template](https://github.com/chalk/chalk-template) - [Tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) support for this module
Expand Down
6 changes: 3 additions & 3 deletions source/vendor/ansi-styles/index.js
Expand Up @@ -105,7 +105,7 @@ function assembleStyles() {
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
Object.defineProperties(styles, {
rgbToAnsi256: {
value: (red, green, blue) => {
value(red, green, blue) {
// We use the extended greyscale palette here, with the exception of
// black and white. normal palette only has 4 greyscale shades.
if (red === green && green === blue) {
Expand All @@ -128,7 +128,7 @@ function assembleStyles() {
enumerable: false,
},
hexToRgb: {
value: hex => {
value(hex) {
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
if (!matches) {
return [0, 0, 0];
Expand Down Expand Up @@ -157,7 +157,7 @@ function assembleStyles() {
enumerable: false,
},
ansi256ToAnsi: {
value: code => {
value(code) {
if (code < 8) {
return 30 + code;
}
Expand Down
2 changes: 1 addition & 1 deletion test/level.js
Expand Up @@ -38,6 +38,6 @@ test('propagate enable/disable changes from child colors', t => {
});

test('disable colors if they are not supported', async t => {
const {stdout} = await execaNode(fileURLToPath(new URL('./_fixture.js', import.meta.url)));
const {stdout} = await execaNode(fileURLToPath(new URL('_fixture.js', import.meta.url)));
t.is(stdout, 'testout testerr');
});

0 comments on commit 96f44c9

Please sign in to comment.