Socket
Socket
Sign inDemoInstall

picocolors

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.1.0

picocolors.browser.cjs

33

package.json
{
"name": "picocolors",
"version": "0.0.1",
"version": "0.1.0",
"type": "module",
"main": "picocolors.js",
"module": "picocolors.js",
"exports": "picocolors.js",
"main": "./picocolors.cjs",
"module": "./picocolors.js",
"exports": {
".": {
"require": "./picocolors.cjs",
"import": "./picocolors.js",
"default": "./picocolors.js"
},
"./package.json": "./package.json"
},
"browser": {
"./picocolors.js": "./picocolors.browser.js",
"./picocolors.cjs": "./picocolors.browser.cjs"
},
"sideEffects": false,
"description": "The tiniest and the fastest coloring library ever",
"scripts": {
"test": "node test.js"
},
"files": [
"picocolors.d.ts",
"picocolors.js.flow"
"picocolors.*"
],

@@ -26,9 +33,3 @@ "keywords": [

"repository": "alexeyraspopov/picocolors",
"license": "ISC",
"devDependencies": {
"prettier": "^2.4.1"
},
"prettier": {
"printWidth": 100
}
"license": "ISC"
}

@@ -17,4 +17,5 @@ # picocolors

- [`NO_COLOR`](https://no-color.org/) friendly
- The same API, but faster
- No `String.prototype` modifications
- 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

@@ -27,49 +28,8 @@ - Tree-shakeable (in case a Node.js package needs it?)

- [Nanocolors](https://github.com/ai/nanocolors) by [@ai](github.chttps://om/ai)
- [Nanocolors](https://github.com/ai/nanocolors) by [@ai](https://github.com/ai)
- [Colorette](https://github.com/jorgebucaran/colorette) by [@jorgebucaran](https://github.com/jorgebucaran)
- [Kleur](https://github.com/lukeed/kleur) by [@lukeed](https://github.com/lukeed)
- [Colors.js](https://github.com/Marak/colors.js) by [@Marak](https://github/Marak)
- [Colors.js](https://github.com/Marak/colors.js) by [@Marak](https://github.com/Marak)
- [Chalk](https://github.com/chalk/chalk) by [@sindresorhus](https://github.com/sindresorhus)
## Benchmarks
`nanocolors` [benchmark](https://github.com/ai/nanocolors/tree/main/test):
```diff
./test/size.js
Data from packagephobia.com
chalk 101 kB
cli-color 1249 kB
ansi-colors 25 kB
kleur 21 kB
colorette 16 kB
nanocolors 16 kB
+picocolors 8 kB
```
```diff
$ ./test/complex-benchmark.js
chalk 2,618,824 ops/sec
cli-color 326,445 ops/sec
ansi-colors 1,057,188 ops/sec
kleur 2,543,659 ops/sec
kleur/colors 2,841,679 ops/sec
colorette 3,219,038 ops/sec
nanocolors 3,672,600 ops/sec
+picocolors 6,079,950 ops/sec
```
`colorette` [benchmark](https://github.com/jorgebucaran/colorette/tree/main/bench):
```diff
$ npm start
+picocolors × 1,203,773 ops/sec
chalk × 474,359 ops/sec
kleur × 482,915 ops/sec
colors × 233,138 ops/sec
colorette × 657,896 ops/sec
nanocolors × 660,817 ops/sec
ansi-colors × 290,986 ops/sec
```
## Replacing nanocolors

@@ -83,1 +43,5 @@

```
## API
The same as in [`nanocolors`](https://github.com/ai/nanocolors#api)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc