Comparing version 0.8.0 to 0.9.0
@@ -0,1 +1,5 @@ | ||
### 0.9 | ||
- Add CommonJS exports | ||
### 0.8 | ||
@@ -29,3 +33,3 @@ | ||
- Make the library 100% ESM | ||
- Make the library ESM-first | ||
- Add code coverage reports | ||
@@ -32,0 +36,0 @@ |
{ | ||
"name": "colord", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "👑 A tiny yet powerful tool for high-performance color manipulations and conversions", | ||
@@ -23,28 +23,19 @@ "keywords": [ | ||
"type": "module", | ||
"engines": { | ||
"node": ">=12" | ||
}, | ||
"main": "./dist/index.js", | ||
"browser": { | ||
".": "./dist/index.js", | ||
"./plugins/a11y": "./dist/plugins/a11y.js", | ||
"./plugins/names": "./dist/plugins/names.js", | ||
"./plugins/xyz": "./dist/plugins/xyz.js" | ||
}, | ||
"module": "./index.js", | ||
"main": "./index.cjs", | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./plugins/*": "./dist/plugins/*.js" | ||
".": { | ||
"import": "./index.js", | ||
"require": "./index.cjs" | ||
}, | ||
"./plugins/*": { | ||
"import": "./plugins/*.js", | ||
"require": "./plugins/*.cjs" | ||
} | ||
}, | ||
"files": [ | ||
"dist/*.{js,ts,map}", | ||
"dist/plugins/*.{js,ts,map}" | ||
"*.{js,cjs,ts,map}", | ||
"plugins/*.{js,cjs,ts,map}" | ||
], | ||
"types": "dist/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"plugins/*": [ | ||
"dist/plugins/*" | ||
] | ||
} | ||
}, | ||
"types": "index.d.ts", | ||
"scripts": { | ||
@@ -57,3 +48,4 @@ "lint": "eslint src/**/*.ts", | ||
"build": "rm -rf ./dist/* && rollup --config", | ||
"prepublishOnly": "npm run build" | ||
"release": "npm run build && cp *.json dist && cp *.md dist && npm publish dist", | ||
"check-release": "npm run release -- --dry-run" | ||
}, | ||
@@ -60,0 +52,0 @@ "dependencies": {}, |
@@ -31,4 +31,4 @@ <div align="center"> | ||
- 📦 **Small**: Just **1.4 KB** gzipped ([3+ times lighter](#benchmarks) than **color** and **tinycolor2**) | ||
- 🚀 **Fast**: [2+ times faster](#benchmarks) than **color** and **tinycolor2** | ||
- 📦 **Small**: Just **1.4 KB** gzipped ([3x+ lighter](#benchmarks) than **color** and **tinycolor2**) | ||
- 🚀 **Fast**: [2x+ faster](#benchmarks) than **color** and **tinycolor2** | ||
- 😍 **Simple**: Chainable API and familiar patterns | ||
@@ -39,3 +39,3 @@ - 💪 **Immutable**: No need to worry about data mutations | ||
- 🏗 **Extendable**: Built-in [plugin system](#plugins) to add new functionality | ||
- 👫 **Works everywhere**: Supports all browsers and Node 12+ | ||
- 👫 **Works everywhere**: Supports all browsers and Node.js | ||
- 💨 **Dependency-free** | ||
@@ -49,7 +49,7 @@ | ||
| ----------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | | ||
| <nobr><b>colord 👑</b></nobr> | <nobr><b>2 274 420</b></nobr> | [![](https://badgen.net/bundlephobia/min/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/bundlephobia/minzip/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/bundlephobia/dependency-count/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/npm/types/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | | ||
| color | 717 048 | [![](https://badgen.net/bundlephobia/min/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/bundlephobia/minzip/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/bundlephobia/dependency-count/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/npm/types/color?color=e6591d&label=)](https://bundlephobia.com/result?p=color) | | ||
| tinycolor2 | 956 285 | [![](https://badgen.net/bundlephobia/min/tinycolor2?color=red&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/bundlephobia/minzip/tinycolor2?color=red&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/bundlephobia/dependency-count/tinycolor2?color=6ead0a&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/npm/types/tinycolor2?color=e6591d&label=)](https://bundlephobia.com/result?p=tinycolor2) | | ||
| ac-colors | 637 469 | [![](https://badgen.net/bundlephobia/min/ac-colors?color=e6591d&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/bundlephobia/minzip/ac-colors?color=e6591d&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/bundlephobia/dependency-count/ac-colors?color=6ead0a&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/npm/types/ac-colors?color=red&label=)](https://bundlephobia.com/result?p=ac-colors) | | ||
| chroma-js | 900 826 | [![](https://badgen.net/bundlephobia/min/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/bundlephobia/minzip/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/bundlephobia/dependency-count/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/npm/types/chroma-js?color=e6591d&label=)](https://bundlephobia.com/result?p=chroma-js) | | ||
| <nobr><b>colord 👑</b></nobr> | <nobr><b>2,274,420</b></nobr> | [![](https://badgen.net/bundlephobia/min/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/bundlephobia/minzip/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/bundlephobia/dependency-count/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/npm/types/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | | ||
| color | 717,048 | [![](https://badgen.net/bundlephobia/min/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/bundlephobia/minzip/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/bundlephobia/dependency-count/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/npm/types/color?color=e6591d&label=)](https://bundlephobia.com/result?p=color) | | ||
| tinycolor2 | 956,285 | [![](https://badgen.net/bundlephobia/min/tinycolor2?color=red&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/bundlephobia/minzip/tinycolor2?color=red&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/bundlephobia/dependency-count/tinycolor2?color=6ead0a&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/npm/types/tinycolor2?color=e6591d&label=)](https://bundlephobia.com/result?p=tinycolor2) | | ||
| ac-colors | 637,469 | [![](https://badgen.net/bundlephobia/min/ac-colors?color=e6591d&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/bundlephobia/minzip/ac-colors?color=e6591d&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/bundlephobia/dependency-count/ac-colors?color=6ead0a&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/npm/types/ac-colors?color=red&label=)](https://bundlephobia.com/result?p=ac-colors) | | ||
| chroma-js | 900,826 | [![](https://badgen.net/bundlephobia/min/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/bundlephobia/minzip/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/bundlephobia/dependency-count/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/npm/types/chroma-js?color=e6591d&label=)](https://bundlephobia.com/result?p=chroma-js) | | ||
@@ -436,4 +436,5 @@ The performance results were generated on a MBP 2019, 2,6 GHz Intel Core i7 via running `npm run benchmark` in the library folder. See [tests/benchmark.ts](https://github.com/omgovich/colord/blob/master/tests/benchmark.ts). | ||
colord("#777777").isReadable(); // false (gray on white) | ||
colord("#e60000").isReadable("#ffff47"); // true (red on yellow conforms WCAG AA) | ||
colord("#e60000").isReadable("#ffff47", "AAA"); // false (red on yellow does not conform WCAG AAA) | ||
colord("#e60000").isReadable("#ffff47"); // true (normal red text on yellow bg conforms to WCAG AA) | ||
colord("#e60000").isReadable("#ffff47", { level: "AAA" }); // false (normal red text on yellow bg does not conform to WCAG AAA) | ||
colord("#e60000").isReadable("#ffff47", { level: "AAA", size: "large" }); // true (large red text on yellow bg conforms to WCAG AAA) | ||
``` | ||
@@ -440,0 +441,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49039
20
233
511
1