1.0.5 • Published 8 years ago
minify-hex-code v1.0.5
minify-hex-code
Convert 6-character hex codes to 3-characters
Installation
npm install minify-hex-code
yarn add minify-hex-codeUsage
In a node project
Import the script to your project
import minifyHexCode from 'minify-hex-code';
// or
const minifyHexCode = require('minify-hex-code');And execute the script:
const shortHexCode = minifyHexCode('#000000'); // #000
const shortHexCode = minifyHexCode('#eeeeee'); // #000
const shortHexCode = minifyHexCode();          // throws errorContributing
Fork the repo and clone locally, then run:
yarn installThis will install the devDependencies packages and build the lib folder.
Once you've made your desired changes, make sure to write any new tests for your feature and run the tests:
yarn run lint # lints js
yarn test     # runs test suiteIf all tests pass, create a pull request.