{"name":"github-buttons","version":"2.31.0","keywords":["github","button","frontend","component"],"author":{"url":"https://ntk.me/","name":"なつき","email":"i@ntk.me"},"license":"BSD-2-Clause","_id":"github-buttons@2.31.0","maintainers":[{"name":"ntkme","email":"i@ntk.me"}],"homepage":"https://buttons.github.io/","bugs":{"url":"https://github.com/buttons/github-buttons/issues"},"dist":{"shasum":"b6c73df311ed69dc10eafd6a13fe52680e2ec749","tarball":"http://registry-npm.ywwl.com/github-buttons/download/github-buttons-2.31.0.tgz","fileCount":9,"integrity":"sha512-XaR6cZEvVkLMnHv8K3j6FmZLAEH8AMuEkiBPj/vSHU8nt0iW5vYxhIa70ZPc4DsKAg7Latg3CcfIju/KunFaTQ==","signatures":[{"sig":"MEYCIQCya5IzTmDneUYbikXunV5wegzns9lrAoJ2Tb1XMwn7uwIhAPpcMNVkUtNV4WpCXW5LWujkH63Zrdn/oYN5VsEjUxFi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/github-buttons@2.31.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":109431,"size":16498,"noattachment":false,"key":"/github-buttons/-/github-buttons-2.31.0.tgz"},"main":"dist/buttons.common.js","types":"dist/buttons.d.ts","unpkg":"dist/buttons.min.js","module":"dist/buttons.esm.js","gitHead":"332e74ba892bac76f8ac65e6054ac375db4dbb72","scripts":{"lint":"eslint .","test":"babel-node --presets @babel/preset-env -- node_modules/karma/bin/karma start --single-run","build":"rollup -c rollup.config.mjs","pretest":"npm run lint"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8450da03-6a41-4c85-b63c-1fc2e51e45d5"}},"jsdelivr":"dist/buttons.min.js","repository":{"url":"git+https://github.com/buttons/github-buttons.git","type":"git"},"_npmVersion":"11.6.2","description":"GitHub Buttons","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.5.0","sass":"^1.97.2","karma":"^6.4.4","mocha":"^11.7.5","sinon":"^21.0.1","eslint":"^8.57.0","rollup":"^4.55.1","karma-chai":"^0.1.0","sinon-chai":"^3.7.0","@babel/node":"^7.28.6","karma-mocha":"^2.0.1","karma-sinon":"^1.0.5","karma-coverage":"^2.2.1","@primer/octicons":"^19.21.2","karma-sinon-chai":"^2.0.2","@babel/preset-env":"^7.28.6","@primer/primitives":"^11.3.2","eslint-plugin-node":"^11.1.0","@rollup/plugin-html":"^2.0.0","@rollup/plugin-json":"^6.1.0","@rollup/pluginutils":"^5.3.0","eslint-plugin-import":"^2.32.0","karma-mocha-reporter":"^2.2.5","@rollup/plugin-terser":"^0.4.4","eslint-plugin-promise":"^6.6.0","karma-chrome-launcher":"^3.2.0","karma-safari-launcher":"^1.0.0","@rollup/plugin-replace":"^6.0.3","eslint-config-standard":"^17.1.0","karma-firefox-launcher":"^2.1.3","rollup-plugin-istanbul":"^5.0.0","karma-rollup-preprocessor":"^7.0.8","@rollup/plugin-node-resolve":"^16.0.3"},"_npmOperationalInternal":{"tmp":"tmp/github-buttons_2.31.0_1770003261039_0.29496888600361726","host":"s3://npm-registry-packages-npm-production"},"readme":"github-buttons\n==============\n\n[![build](https://github.com/buttons/github-buttons/actions/workflows/build.yml/badge.svg)](https://github.com/buttons/github-buttons/actions/workflows/build.yml)\n[![npm](https://img.shields.io/npm/v/github-buttons)](https://www.npmjs.com/github-buttons)\n\nUsage\n-----\n\n### Use as a Snippet\n\nGet started quickly with **[github:button configurator](https://buttons.github.io)**.\n\n### Use as a Component\n\n- [vue-github-button](https://github.com/buttons/vue-github-button) for [Vue](https://vuejs.org)\n- [react-github-btn](https://github.com/buttons/react-github-btn) for [React](https://reactjs.org)\n\n### Use as a Module\n\n``` javascript\nimport { render } from 'github-buttons'\n\n// export function render(options: object, callback: (el: HTMLElement) => void): void;\nrender(options, function (el) {\n  document.body.appendChild(el) \n})\n\n// export function render(anchor: HTMLAnchorElement, callback: (el: HTMLElement) => void): void;\nrender(anchor, function (el) {\n  anchor.parentNode.replaceChild(el, anchor)\n})\n```\n\n### Options\n\n- For snippet usage, an option is an attribute on `<a>` element.\n- For component usage, an option is a prop on component.\n- For module usage, an option is a property on `options` object.\n\n##### `href`\n\n- Type: `string` \n- Default: `'#'`\n\nAssign `href` attribute (GitHub link) for button.\n\n##### `title`\n\n- Type: `string`\n- Default: `undefined`\n\nAssign `title` attribute for button.\n\n##### `data-icon`\n\n- Type: `string`\n- Default: `'octicon-mark-github'`\n\nSet icon on button. A [subset](rollup.config.mjs) of [Octicons](https://primer.style/octicons/) is bundled.\n\n##### `data-color-scheme`\n\n- Type: `string`\n- Default: `undefined`\n\nDefine a mapping of system color scheme to widget color scheme in css-like syntax.\n\nThis is an _opt-in_ feature since version `>=2.3.0`. It means if `data-color-scheme` is `undefined`, it would still behave like version `<2.3.0`, where light color scheme is used under all conditions.\n\nOnce `data-color-scheme` is set to a string, it will inherit the default mapping: `no-preference: light; light: light; dark: dark;`.\n\n- `no-preference: light;` means when system has no preference on color scheme, light color scheme will be used.\n- `light: light;` means when system prefers light color scheme, light color scheme will be used.\n- `dark: dark;` means when system prefers dark color scheme, dark color scheme will be used.\n\nUser declarations would override the default. For example:\n\n- To enable color scheme using default, set `data-color-scheme=\"\"`.\n- To use dark color scheme when system has no preference, set `data-color-scheme=\"no-preference: dark;\"`.\n- To force light color scheme everywhere, set `data-color-scheme=\"dark: light;\"`.\n- To force dark color scheme everywhere, set `data-color-scheme=\"no-preference: dark; light: dark;\"`.\n\nA single word can be used to force the color scheme everywhere since version `>=2.11.0`. For example:\n\n- To force light color scheme everywhere, set `data-color-scheme=\"light\"`.\n- To force dark color scheme everywhere, set `data-color-scheme=\"dark\"`.\n\n##### `data-size`\n\n- Type: `string`\n- Default: `undefined`\n\nSet button size. Possible values are `undefined` and `'large'`.\n\n##### `data-show-count`\n\n- Type: `boolean`\n- Default: `false`\n\nShow a dynamic count based on button type (detected from `href`):\n\n- `https://github.com/:user` (follow)\n- `https://github.com/:user/:repo` (star)\n- `https://github.com/:user/:repo/subscription` (watch)\n- `https://github.com/:user/:repo/fork` (fork)\n- `https://github.com/:user/:repo/issues` (issues)\n- `https://github.com/:user/:repo/issues/new` (issues)\n\nTailing slash, query string, and hash in the `href` won't affect type detection:\n\n- `https://github.com/:user/` (follow)\n- `https://github.com/:user?tab=repositories` (follow)\n- `https://github.com/:user/:repo#readme` (star)\n- `https://github.com/:user/:repo/#readme` (star)\n\n##### `data-text`\n\n- Type: `string`\n- Default: `undefined`\n\nSet button text. When button is generated from `<a>` element and `data-text` is `undefined`, the button text will be anchor's `textContent`.\n\n##### `aria-label`\n\n- Type: `string`\n- Default: `undefined`\n\nSet `aira-label` for button.\n\n---\n\nSee also\n--------\n\n- [mdo/github-buttons](https://ghbtns.com)\n\n---\n\nLicense\n-------\n\nSee [LICENSE](LICENSE).\n","publish_time":1770003261187,"_cnpm_publish_time":1770003261187,"dist-tags":{"latest":"2.33.1"}}