{"name":"badgen","version":"3.2.3","author":{"name":"Amio","email":"amio.cn@gmail.com"},"license":"MIT","_id":"badgen@3.2.3","maintainers":[{"name":"amio","email":"amio.cn@gmail.com"}],"homepage":"https://github.com/amio/badgen#readme","bugs":{"url":"https://github.com/amio/badgen/issues"},"dist":{"shasum":"d050e3fa99e5929e9b93cab98d8fb612b5a8b2ef","tarball":"http://registry-npm.ywwl.com/badgen/download/badgen-3.2.3.tgz","fileCount":11,"integrity":"sha512-svDuwkc63E/z0ky3drpUppB83s/nlgDciH9m+STwwQoWyq7yCgew1qEfJ+9axkKdNq7MskByptWUN9j1PGMwFA==","signatures":[{"sig":"MEUCIGd0EBoz5o0bYwHFjsViJ/sc0kph6qTnyUNHrcPUTY+KAiEAwCCaV74hBe1Qulp9XQvJo2lcyDxRNU0fDNJG8Jj23Lc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90539,"size":14403,"noattachment":false,"key":"/badgen/-/badgen-3.2.3.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.browser.js","gitHead":"a303e46dadee065e99f8d9b23feb14208117ff98","scripts":{"test":"tap --no-check-coverage","bench":"node bench/index.js","build":"npm run build:browser && npm run build:node","esbuild":"esbuild src/index.ts --bundle --minify --sourcemap","prepack":"npm run build","pretest":"npm run build","preview":"node preview/serve.js","prebuild":"rm -rf dist","postbuild":"npm run build:types","snaptests":"TAP_SNAPSHOT=1 npm test","build:node":"npm run esbuild -- --platform=node --outfile=dist/index.js","build:types":"tsc --emitDeclarationOnly","build:browser":"npm run esbuild -- --outfile=dist/index.browser.js"},"_npmUser":{"name":"amio","email":"amio.cn@gmail.com"},"repository":{"url":"git+https://github.com/amio/badgen.git","type":"git"},"_npmVersion":"9.5.1","description":"Fast svg badge generator.","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"tap":"^16.1.0","esbuild":"^0.14.38","benchmark":"^2.1.4","typescript":"^4.1.2","@types/node":"^14.0.14","serve-marked":"^3.1.0"},"_npmOperationalInternal":{"tmp":"tmp/badgen_3.2.3_1689941439336_0.08864843465051142","host":"s3://npm-registry-packages"},"readme":"# badgen\n\n[![npm version][npm-src]][npm-href]\n[![Coverage Status][coveralls-src]][coveralls-href]\n[![Bundle size][bundlephobia-src]][bundlephobia-href]\n[![License][license-src]][license-href]\n\nFast handcraft svg badge generator. Used on [badgen.net](https://badgen.net).\n\n- 🌀 Zero dependency\n- ⚡️ Fast by design (see [benchmarks](#benchmarks))\n- 👯‍ Running in node & browser\n\n## Usage\n\n`npm install badgen`\n\n```javascript\nconst { badgen } = require('badgen')\n\n// only `status` is required.\nconst svgString = badgen({\n  label: 'npm',      // <Text>\n  labelColor: 'ADF', // <Color RGB> or <Color Name> (default: '555')\n  status: 'v1.2.3',  // <Text>, required\n  color: 'blue',     // <Color RGB> or <Color Name> (default: 'blue')\n  style: 'flat',     // 'flat' or 'classic' (default: 'classic')\n  icon: 'data:image/svg+xml;base64,...', // Use icon (default: undefined)\n  iconWidth: 13,     // Set this if icon is not square (default: 13)\n  scale: 1           // Set badge scale (default: 1)\n})\n```\n\n```javascript\nimport { badgen } from 'badgen'\n```\n\nAvailable color names:\n\n![](https://badgen.net/badge/color/blue/blue)\n![](https://badgen.net/badge/color/cyan/cyan)\n![](https://badgen.net/badge/color/green/green)\n![](https://badgen.net/badge/color/yellow/yellow)\n![](https://badgen.net/badge/color/orange/orange)\n![](https://badgen.net/badge/color/red/red)\n![](https://badgen.net/badge/color/pink/pink)\n![](https://badgen.net/badge/color/purple/purple)\n![](https://badgen.net/badge/color/grey/grey)\n![](https://badgen.net/badge/color/black/black)\n\n### In browser\n\n```html\n<script src=\"https://unpkg.com/badgen\"></script>\n<script>\n  var svgString = badgen({ /*...*/ })\n</script>\n```\n\n## Benchmarks\n\n`npm run bench` on iMac 5K (Late 2014), 3.5G i5, with Node.js 12.11.0:\n\n```bash\n[classic] style, long params x 985,898 ops/sec ±0.37% (94 runs sampled)\n[classic] style, full params x 1,284,886 ops/sec ±0.42% (95 runs sampled)\n[classic] style, with emoji  x 1,291,768 ops/sec ±0.28% (95 runs sampled)\n[classic] style, with icon   x 1,177,120 ops/sec ±0.94% (95 runs sampled)\n   [flat] style, long params x 780,504 ops/sec ±0.39% (94 runs sampled)\n   [flat] style, full params x 1,012,111 ops/sec ±0.40% (97 runs sampled)\n   [flat] style, with emoji  x 1,013,695 ops/sec ±0.91% (95 runs sampled)\n   [flat] style, with icon   x 994,481 ops/sec ±0.30% (94 runs sampled)\n```\n\n## Development\n\n- `npm test` builds `dist/` and runs the suite with Node's native test runner.\n- `npm run snaptests` updates the checked-in snapshots.\n- `npm run preview` starts the Vite preview app with live reload at `http://localhost:5173/`.\n\n## See Also\n\n- [gradient-badge][gradient-badge] - Badge generator with color gradient support\n\n[npm-src]: https://badgen.net/npm/v/badgen\n[npm-href]: https://www.npmjs.com/package/badgen\n[bundlephobia-src]: https://badgen.net/bundlephobia/minzip/badgen\n[bundlephobia-href]: https://bundlephobia.com/result?p=badgen\n[coveralls-src]: https://badgen.net/coveralls/c/github/amio/badgen/master\n[coveralls-href]: https://coveralls.io/github/amio/badgen?branch=master\n[license-src]: https://badgen.net/github/license/amio/badgen\n[license-href]: LICENSE.md\n[gradient-badge]: https://github.com/bokub/gradient-badge\n","publish_time":1689941439499,"_cnpm_publish_time":1689941439499,"dist-tags":{"latest":"3.3.2"}}