Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tinycolor2

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinycolor2 - npm Package Compare versions

Comparing version 1.5.1 to 1.6.0-beta.1

cjs/package.json

25

package.json
{
"version": "1.5.1",
"version": "1.6.0-beta.1",
"name": "tinycolor2",

@@ -17,14 +17,19 @@ "description": "Fast Color Parsing and Manipulation",

"author": "Brian Grinstead <briangrinstead@gmail.com> (http://briangrinstead.com)",
"main": "./tinycolor.js",
"engines": {
"node": "*"
"bugs": {
"url": "https://github.com/bgrins/TinyColor/issues"
},
"module": "./esm/tinycolor.js",
"main": "./cjs/tinycolor.js",
"exports": {
".": {
"import": "./esm/tinycolor.js",
"require": "./cjs/tinycolor.js"
}
},
"scripts": {
"test": "node cjs/test.js && node esm/test.js"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-jshint": "~0.1.1",
"grunt-contrib-qunit": "^4.0.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-docco": "~0.2.0"
"@deno/shim-deno-test": "^0.4.0"
}
}

49

README.md

@@ -7,28 +7,50 @@ # TinyColor

[![Build Status](https://travis-ci.org/bgrins/TinyColor.png?branch=master)](https://travis-ci.org/bgrins/TinyColor)
## Including in node
`tinycolor` can be installed from npm:
npm install tinycolor2
Then it can be used in your script like so:
```js
var tinycolor = require("tinycolor2");
var color = tinycolor("red");
```
Or in a module like so:
```js
import tinycolor from "tinycolor2";
var color = tinycolor("red");
```
## Including in a browser
Download [tinycolor.js](https://raw.githubusercontent.com/bgrins/TinyColor/master/tinycolor.js) or install it with bower:
The package can be bundled from npm, but if you prefer to download it locally you have two choices:
bower install tinycolor
### ESM
Then just include it in the page in a `script` tag:
** Note: This support is in progress and was landed in [1.5.0](https://www.npmjs.com/package/tinycolor2/v/1.5.0) but has been temporarily reverted in 1.5.1 due to a bug report: https://github.com/bgrins/TinyColor/issues/249 **
It can be used as a module by downloading [npm/esm/tinycolor.js](https://github.com/bgrins/TinyColor/blob/master/npm/esm/tinycolor.js) or using https://esm.sh/tinycolor2.
```html
<script type='text/javascript' src='tinycolor.js'></script>
<script type='text/javascript'>
<script type='module'>
import tinycolor from "https://esm.sh/tinycolor2";
var color = tinycolor("red");
</script>
```
## Including in node
`tinycolor` may also be included as a [node](http://nodejs.org/) module like so:
### UMD
npm install tinycolor2
You can use it directly in a script tag by downloading the UMD file from [npm/cjs/tinycolor.js](https://github.com/bgrins/TinyColor/blob/master/npm/cjs/tinycolor.js):
Then it can be used in your script like so:
```js
var tinycolor = require("tinycolor2");
```html
<script type='text/javascript' src='tinycolor.js'></script>
<script type='text/javascript'>
var color = tinycolor("red");
</script>
```
## Usage

@@ -91,2 +113,5 @@

### Named
Case insenstive names are accepted, using the [list of colors in the CSS spec](https://www.w3.org/TR/css-color-4/#named-colors).
```js

@@ -93,0 +118,0 @@ tinycolor("RED");

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc