github-buttons
Advanced tools
Comparing version 0.0.1-security to 1.0.0
{ | ||
"name": "github-buttons", | ||
"version": "0.0.1-security", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"version": "1.0.0", | ||
"description": "GitHub Buttons", | ||
"keywords": [ | ||
"github", | ||
"buttons", | ||
"vue", | ||
"react", | ||
"angular" | ||
], | ||
"license": "BSD-2-Clause", | ||
"homepage": "https://buttons.github.io/", | ||
"bugs": { | ||
"url": "https://github.com/ntkme/github-buttons/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/npm/security-holder.git" | ||
"url": "https://github.com/ntkme/github-buttons.git" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/npm/security-holder/issues" | ||
"author": { | ||
"name": "なつき", | ||
"email": "i@ntk.me", | ||
"url": "https://ntk.me/" | ||
}, | ||
"homepage": "https://github.com/npm/security-holder#readme" | ||
"main": "dist/buttons.common.js", | ||
"module": "dist/buttons.esm.js", | ||
"typings": "dist/buttons.d.ts", | ||
"scripts": { | ||
"build": "rollup -c rollup.config.js", | ||
"pretest": "coffeelint src/ test/", | ||
"test": "karma start --single-run" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"codecov": "^3.2.0", | ||
"coffee-loader": "^0.9.0", | ||
"coffeelint": "^2.1.0", | ||
"coffeescript": "=1.12.7", | ||
"istanbul-instrumenter-loader": "^3.0.1", | ||
"karma": "^4.0.0", | ||
"karma-chai": "^0.1.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-coverage-istanbul-reporter": "^2.0.4", | ||
"karma-firefox-launcher": "^1.1.0", | ||
"karma-mocha": "^1.3.0", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"karma-safari-launcher": "^1.0.0", | ||
"karma-sinon": "^1.0.5", | ||
"karma-sinon-chai": "^2.0.2", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^3.0.5", | ||
"mocha": "^5.2.0", | ||
"node-sass": "^4.11.0", | ||
"octicons": "^8.4.1", | ||
"raw-loader": "^1.0.0", | ||
"rollup": "^1.1.2", | ||
"rollup-plugin-coffee-script": "^2.0.0", | ||
"rollup-plugin-json": "^3.1.0", | ||
"rollup-plugin-node-resolve": "^4.0.0", | ||
"rollup-plugin-replace": "^2.1.0", | ||
"rollup-plugin-uglify": "^6.0.2", | ||
"rollup-watch": "^4.3.1", | ||
"sass-loader": "^7.1.0", | ||
"sinon": "^7.2.3", | ||
"sinon-chai": "^3.3.0", | ||
"webpack": "^4.29.3" | ||
}, | ||
"engines": { | ||
"node": ">=6.5.0" | ||
} | ||
} |
169
README.md
@@ -1,9 +0,164 @@ | ||
# Security holding package | ||
github-buttons | ||
============== | ||
This package name is not currently in use, but was formerly occupied | ||
by another package. To avoid malicious use, npm is hanging on to the | ||
package name, but loosely, and we'll probably give it to you if you | ||
want it. | ||
[![CircleCI](https://img.shields.io/circleci/project/github/ntkme/github-buttons.svg)](https://circleci.com/gh/ntkme/github-buttons) | ||
[![Codecov](https://img.shields.io/codecov/c/github/ntkme/github-buttons.svg)](https://codecov.io/gh/ntkme/github-buttons) | ||
You may adopt this package by contacting support@npmjs.com and | ||
requesting the name. | ||
To get started, checkout **[buttons.github.io](https://buttons.github.io)**! | ||
Documentation | ||
------------- | ||
### Quick Start | ||
The easiest way to get started is to use the **[github:button configurator](https://buttons.github.io)**. | ||
The source code for the configurator is at [ntkme/github-buttons-app](https://github.com/ntkme/github-buttons-app). | ||
### Components | ||
- [vue-github-button](https://github.com/ntkme/vue-github-button) for [Vue](https://vuejs.org) | ||
### Basic Usage (without component) | ||
#### Markup Syntax | ||
``` html | ||
<!-- Place this tag where you want the button to render. --> | ||
<a class="github-button" | ||
href="{{ link }}" | ||
title="{{ title }}" | ||
data-icon="{{ octicon }}" | ||
data-size="{{ size }}" | ||
data-show-count="{{ show count }}" | ||
data-text="{{ text }}" | ||
aria-label="{{ aria label }}" | ||
>{{ text }}</a> | ||
``` | ||
``` html | ||
<!-- Place this tag in your head or just before your close body tag. --> | ||
<script async defer src="https://buttons.github.io/buttons.js"></script> | ||
``` | ||
#### Config | ||
| Attribute | Description | | ||
| --------- | ----------- | | ||
| `href` | GitHub link for the button. | | ||
| `title` | `title` attribute for the button's `<iframe>`. | | ||
| `data-icon` | `octicon-mark-github` by default. A [subset](rollup.config.js) of [Octicons](https://octicons.github.com) is bundled. | | ||
| `data-size` | _None_ by default or `large`. | | ||
| `data-show-count` | `false` by default or `true`. The dynamic count is generated based on detected button type. | | ||
| `data-text` | Text displayed on the button. It defaults to the text content within the link. | | ||
| `aria-label` | Aira label for the button link. | | ||
##### Built-in Button Types | ||
Button type is detected through button's `href` attribute. | ||
- `https://github.com/:user` (follow) | ||
- `https://github.com/:user/:repo` (star) | ||
- `https://github.com/:user/:repo/subscription` (watch) | ||
- `https://github.com/:user/:repo/fork` (fork) | ||
- `https://github.com/:user/:repo/issues` (issues) | ||
- `https://github.com/:user/:repo/issues/new` (issues) | ||
Tailing slash, query string, and hash in the `href` are handled. | ||
- `https://github.com/:user/` (follow) | ||
- `https://github.com/:user?tab=repositories` (follow) | ||
- `https://github.com/:user/:repo#license` (star) | ||
- `https://github.com/:user/:repo/#license` (star) | ||
### Advanced Usage | ||
#### Import as a Module | ||
This module works with CommonJS or AMD loader. | ||
The default behavior of including the `<script>` tag is to render all the `<a class="github-button">` tags on the page. **This behavior is turned off when loading as a module.** | ||
``` javascript | ||
var GitHubButtons = require('github-buttons') | ||
``` | ||
It is recommended to use a module bundler rather than a module loader. | ||
###### Using button.js with RequireJS | ||
Loading this module as `<script>` tag together with `require.js` will cause an [error](https://github.com/ntkme/github-buttons/issues/31). | ||
This is _intentional_. To avoid the ambiguity on default behavoir, you should load the module via RequireJS API like following: | ||
``` javascript | ||
require(['https://buttons.github.io/buttons.js'], function (GitHubButtons) { | ||
GitHubButtons.render() | ||
}); | ||
``` | ||
#### Render a Button | ||
To create buttons dynamically, you will use the `render()` function, which is a named export of this module. | ||
``` javascript | ||
GitHubButtons.render(target, config) | ||
``` | ||
- `target` is a DOM node to be replaced by a button. | ||
- `config` is an object containing the attributes. | ||
To append the button to a parent node instead, you need to create a placeholder as target. | ||
``` javascript | ||
GitHubButtons.render(parentNode.appendChild(document.createElement('span')), config) | ||
``` | ||
Alternatively, config can be read from the `target` if it is an Anchor (`<a>`) with attributes. | ||
``` javascript | ||
GitHubButtons.render(target) | ||
``` | ||
Development | ||
----------- | ||
### Clone | ||
``` sh | ||
git clone https://github.com/ntkme/github-buttons.git | ||
``` | ||
``` sh | ||
cd github-buttons && npm install | ||
``` | ||
### Build | ||
``` sh | ||
npm run build | ||
``` | ||
### Test | ||
``` sh | ||
npm test | ||
``` | ||
See also | ||
-------- | ||
- [mdo/github-buttons](https://ghbtns.com) | ||
License | ||
------- | ||
See [LICENSE](LICENSE). |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
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
70212
9
1152
0
0
165
33
5