tinycolor2
Advanced tools
Comparing version 1.5.1 to 1.6.0-beta.1
{ | ||
"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" | ||
} | ||
} |
@@ -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"); |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
1
7293
0
495
229624
12
2