diff --git a/README.md b/README.md index fb2efcd..90e2728 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,30 @@ -# gradient-badges +# gradient-badge -[![npm](https://runkit.io/bokub/gb-v/branches/master)](https://www.npmjs.com/package/gradient-badges) -[![Demo](https://runkit.io/bokub/badge/branches/master/demo/available/11998e-38ef7d)](https://git.io/gradient-badges) -[![XO code style](https://runkit.io/bokub/badge/branches/master/style/XO/ff94c8-cacfda-61eddb)](https://github.com/sindresorhus/xo) -[![License](https://runkit.io/bokub/badge/branches/master/license/MIT/ff426b-ffbc36)](https://github.com/bokub/gradient-badges/blob/master/LICENSE) +[![npm][version]](https://www.npmjs.com/package/gradient-badge) +[![Demo][demo-src]][demo] +[![XO code style][xo]](https://github.com/sindresorhus/xo) +[![License][license]](https://github.com/bokub/gradient-badge/blob/master/LICENSE) -> Badge generator with gradient support +> Badge generator with gradient support 🍭 #### Check out the [demo][demo] to make your own badge ## Install ``` -$ npm i gradient-badges +$ npm i gradient-badge ``` ## Usage -**gradient-badges** works exactly like [badgen](https://github.com/amio/badgen), with the **`gradient`** parameter in addition. +**gradient-badge** works exactly like [badgen](https://github.com/amio/badgen), with the **`gradient`** parameter in addition. **Node.js** ```javascript -const badges = require('gradient-badges') +const gradientBadge = require('gradient-badge') -const svgString = badges({ +const svgString = gradientBadge({ subject: 'version', // status: 'v1.2.3', // style: 'flat', // 'flat' or undefined, optional @@ -34,12 +34,9 @@ const svgString = badges({ **Browser** ```html - - + ``` @@ -68,9 +65,14 @@ Here are a few examples of what you can do. - [badgen](https://github.com/amio/badgen) - Fast handcraft svg badge generator. +[version]: https://runkit.io/bokub/gb-v/branches/master +[demo-src]: https://runkit.io/bokub/badge/branches/master/demo/available/11998e-38ef7d +[xo]: https://runkit.io/bokub/badge/branches/master/style/XO/ff94c8-cacfda-61eddb +[license]: https://runkit.io/bokub/badge/branches/master/license/MIT/ff426b-ffbc36 + [usage]: https://runkit.io/bokub/badge/branches/master/version/v1.2.3/pink-F78642?style=flat -[demo]: https://git.io/gradient-badges +[demo]: https://git.io/gradientbadge [stars]: https://runkit.io/bokub/badge/branches/master/stars/★★★★☆/00a65e-abf269 [standard]: https://runkit.io/bokub/badge/branches/master/code%20style/standard/ff22aa-bf00ff?style=flat diff --git a/package.json b/package.json index 150d895..8f793bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,9 @@ { - "name": "gradient-badges", - "version": "1.1.0", + "name": "gradient-badge", + "description": "Badge generator with gradient support", + "version": "1.2.0", "author": "Boris K", + "bugs": "https://github.com/bokub/gradient-badge/issues", "dependencies": { "badgen": "^2.x" }, @@ -15,9 +17,9 @@ }, "files": [ "index.js", - "dist/gradient-badges.min.js" + "dist/gradient-badge.min.js" ], - "homepage": "https://github.com/bokub/gradient-badges", + "homepage": "https://github.com/bokub/gradient-badge", "keywords": [ "badge", "badgen", @@ -33,6 +35,8 @@ ], "license": "MIT", "main": "index.js", + "repository": "bokub/gradient-badge", + "reveal": true, "scripts": { "coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", "prepublishOnly": "lyo", diff --git a/test.js b/test.js index aeb6ab7..e1572b5 100644 --- a/test.js +++ b/test.js @@ -2,13 +2,13 @@ import test from 'ava'; import isSvg from 'is-svg'; import colorPresets from 'badgen/lib/color-presets'; import badgen from 'badgen'; -import badges from '.'; +import b from '.'; for (const style of ['classic', 'flat']) { const prefix = style === 'classic' ? '[classic] ' : ' [flat] '; const params = {subject: 'version', status: 'v1.2.3', style, gradient: ['pink', 'F78642']}; const original = badgen(params); - const badge = badges(params); + const badge = b(params); test(prefix + 'is svg', t => { t.true(isSvg(badge)); @@ -31,9 +31,9 @@ for (const style of ['classic', 'flat']) { test('returns original badgen if no gradient', t => { const params = {subject: 'version', status: 'v1.2.3'}; - t.is(badges(params), badgen(params)); + t.is(b(params), badgen(params)); params.color = 'green'; - t.is(badges(params), badgen(params)); + t.is(b(params), badgen(params)); params.gradient = 'ff0'; - t.is(badges(params), badgen(params)); + t.is(b(params), badgen(params)); });