New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

badges

Package Overview
Dependencies
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

badges - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

241

es2015/badges.js
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
// Import
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var querystring = require('querystring');

@@ -21,6 +23,6 @@

function badge(_ref) {
var image = _ref.image;
var alt = _ref.alt;
var url = _ref.url;
var title = _ref.title;
var image = _ref.image,
alt = _ref.alt,
url = _ref.url,
title = _ref.title;

@@ -51,9 +53,9 @@ // Check

function shields(_ref2) {
var left = _ref2.left;
var right = _ref2.right;
var _ref2$color = _ref2.color;
var color = _ref2$color === undefined ? 'yellow' : _ref2$color;
var alt = _ref2.alt;
var url = _ref2.url;
var title = _ref2.title;
var left = _ref2.left,
right = _ref2.right,
_ref2$color = _ref2.color,
color = _ref2$color === undefined ? 'yellow' : _ref2$color,
alt = _ref2.alt,
url = _ref2.url,
title = _ref2.title;

@@ -166,4 +168,4 @@ // Check

function nodeico(_ref7) {
var npmPackageName = _ref7.npmPackageName;
var nodeicoQueryString = _ref7.nodeicoQueryString;
var npmPackageName = _ref7.npmPackageName,
nodeicoQueryString = _ref7.nodeicoQueryString;

@@ -197,4 +199,4 @@ // Prepare

function saucelabsbm(_ref8) {
var saucelabsUsername = _ref8.saucelabsUsername;
var saucelabsAuthToken = _ref8.saucelabsAuthToken;
var saucelabsUsername = _ref8.saucelabsUsername,
saucelabsAuthToken = _ref8.saucelabsAuthToken;

@@ -224,4 +226,4 @@ // Check

function saucelabs(_ref9) {
var saucelabsUsername = _ref9.saucelabsUsername;
var saucelabsAuthToken = _ref9.saucelabsAuthToken;
var saucelabsUsername = _ref9.saucelabsUsername,
saucelabsAuthToken = _ref9.saucelabsAuthToken;

@@ -271,4 +273,4 @@ // Check

function codeship(_ref11) {
var codeshipProjectUUID = _ref11.codeshipProjectUUID;
var codeshipProjectID = _ref11.codeshipProjectID;
var codeshipProjectUUID = _ref11.codeshipProjectUUID,
codeshipProjectID = _ref11.codeshipProjectID;

@@ -303,3 +305,3 @@ // Check

var url = 'https://coveralls.io/r/' + githubSlug;
var alt = 'Coverage Status';
var alt = 'Coveralls Coverage Status';
var title = "View this project's coverage on Coveralls";

@@ -311,2 +313,44 @@ return badge({ image: image, alt: alt, url: url, title: title });

/**
Code Climate Rating Badge
@method codeclimate
@param {String} config.githubSlug The github slug that the project lives at (e.g. bevry/badges)
@return {String} the result badge
*/
function codeclimate(_ref13) {
var githubSlug = _ref13.githubSlug;
// Check
if (!githubSlug) throw new Error('githubSlug is missing');
// Create
var image = 'https://img.shields.io/codeclimate/github/' + githubSlug + '.svg';
var url = 'https://codeclimate.com/github/' + githubSlug;
var alt = 'Code Climate Rating';
var title = "View this project's rating on Code Climate";
return badge({ image: image, alt: alt, url: url, title: title });
}
codeclimate.badgeCategory = 'testing';
/**
BitHound Score Badge
@method bithound
@param {String} config.githubSlug The github slug that the project lives at (e.g. bevry/badges)
@return {String} the result badge
*/
function bithound(_ref14) {
var githubSlug = _ref14.githubSlug;
// Check
if (!githubSlug) throw new Error('githubSlug is missing');
// Create
var image = 'https://bithound.io/github/' + githubSlug + '/badges/score.svg';
var url = 'https://bithound.io/github/' + githubSlug;
var alt = 'BitHound Score';
var title = "View this project's score on BitHound";
return badge({ image: image, alt: alt, url: url, title: title });
}
bithound.badgeCategory = 'testing';
/**
Waffle Badge

@@ -317,4 +361,4 @@ @method waffle

*/
function waffle(_ref13) {
var githubSlug = _ref13.githubSlug;
function waffle(_ref15) {
var githubSlug = _ref15.githubSlug;

@@ -344,5 +388,5 @@ // Check

*/
function sixtydevstips(_ref14) {
var sixtydevstipsID = _ref14.sixtydevstipsID;
var sixtydevstipsURL = _ref14.sixtydevstipsURL;
function sixtydevstips(_ref16) {
var sixtydevstipsID = _ref16.sixtydevstipsID,
sixtydevstipsURL = _ref16.sixtydevstipsURL;

@@ -367,9 +411,9 @@ // Check

@method patreon
@param {String} config.patreonUsername The patreon username to donate to
@param {String} config.patreonURL The url to the patreon donate page
@param {String} config.patreonUsername The Patreon username to donate to
@param {String} config.patreonURL The url to the Patreon donate page
@return {String} the result badge
*/
function patreon(_ref15) {
var patreonUsername = _ref15.patreonUsername;
var patreonURL = _ref15.patreonURL;
function patreon(_ref17) {
var patreonUsername = _ref17.patreonUsername,
patreonURL = _ref17.patreonURL;

@@ -379,3 +423,3 @@ // Check

if (!patreonUsername) throw new Error('patreonUsername is missing');
patreonURL = 'http://patreon.com/' + patreonUsername;
patreonURL = 'https://patreon.com/' + patreonUsername;
}

@@ -393,11 +437,37 @@

/**
Open Collective Badge
@method patreon
@param {String} config.opencollectiveUsername The Open Collective username to donate to
@param {String} config.opencollectiveURL The url to the Open Collective donate page
@return {String} the result badge
*/
function opencollective(_ref18) {
var opencollectiveUsername = _ref18.opencollectiveUsername,
opencollectiveURL = _ref18.opencollectiveURL;
// Check
if (!opencollectiveURL) {
if (!opencollectiveUsername) throw new Error('opencollectiveUsername is missing');
opencollectiveURL = 'https://opencollective.com/' + opencollectiveUsername;
}
// Create
var image = 'https://img.shields.io/badge/open%20collective-donate-yellow.svg';
var url = opencollectiveURL;
var alt = 'Open Collective donate button';
var title = 'Donate to this project using Open Collective';
return badge({ image: image, alt: alt, url: url, title: title });
}
opencollective.badgeCategory = 'funding';
/**
Gratipay Badge
@method gratipay
@param {String} config.gratipayUsername The gratipay username to donate to
@param {String} config.gratipayURL The url to the gratipay donate page
@param {String} config.gratipayUsername The Gratipay username to donate to
@param {String} config.gratipayURL The url to the Gratipay donate page
@return {String} the result badge
*/
function gratipay(_ref16) {
var gratipayUsername = _ref16.gratipayUsername;
var gratipayURL = _ref16.gratipayURL;
function gratipay(_ref19) {
var gratipayUsername = _ref19.gratipayUsername,
gratipayURL = _ref19.gratipayURL;

@@ -422,11 +492,11 @@ // Check

@method flattr
@param {String} config.flattrCode The flattr code to donate to (e.g. 344188/balupton-on-Flattr)
@param {String} config.flattrUsername The flattr username to donate to (e.g. balupton)
@param {String} config.flattrCode The Flattr code to donate to (e.g. 344188/balupton-on-Flattr)
@param {String} config.flattrUsername The Flattr username to donate to (e.g. balupton)
@param {String} config.flattrURL The url to the flattr donate page
@return {String} the result badge
*/
function flattr(_ref17) {
var flattrCode = _ref17.flattrCode;
var flattrUsername = _ref17.flattrUsername;
var flattrURL = _ref17.flattrURL;
function flattr(_ref20) {
var flattrCode = _ref20.flattrCode,
flattrUsername = _ref20.flattrUsername,
flattrURL = _ref20.flattrURL;

@@ -457,10 +527,10 @@ // Check

@param {String} config.paypalURL The url to the paypal donate page
@param {String} config.paypalButtonID The paypal button id
@param {String} config.paypalUsername The paypal.me username
@param {String} config.paypalButtonID The Paypal button id
@param {String} config.paypalUsername The Paypal.me username
@return {String} the result badge
*/
function paypal(_ref18) {
var paypalURL = _ref18.paypalURL;
var paypalButtonID = _ref18.paypalButtonID;
var paypalUsername = _ref18.paypalUsername;
function paypal(_ref21) {
var paypalURL = _ref21.paypalURL,
paypalButtonID = _ref21.paypalButtonID,
paypalUsername = _ref21.paypalUsername;

@@ -493,4 +563,4 @@ // Check

*/
function bitcoin(_ref19) {
var bitcoinURL = _ref19.bitcoinURL;
function bitcoin(_ref22) {
var bitcoinURL = _ref22.bitcoinURL;

@@ -515,4 +585,4 @@ // Check

*/
function wishlist(_ref20) {
var wishlistURL = _ref20.wishlistURL;
function wishlist(_ref23) {
var wishlistURL = _ref23.wishlistURL;

@@ -540,4 +610,4 @@ // Check

*/
function slackinscript(_ref21) {
var slackinURL = _ref21.slackinURL;
function slackinscript(_ref24) {
var slackinURL = _ref24.slackinURL;

@@ -559,4 +629,4 @@ // Check

*/
function slackin(_ref22) {
var slackinURL = _ref22.slackinURL;
function slackin(_ref25) {
var slackinURL = _ref25.slackinURL;

@@ -583,5 +653,5 @@ // Check

*/
function gabeacon(_ref23) {
var gaTrackingID = _ref23.gaTrackingID;
var githubSlug = _ref23.githubSlug;
function gabeacon(_ref26) {
var gaTrackingID = _ref26.gaTrackingID,
githubSlug = _ref26.githubSlug;

@@ -607,4 +677,4 @@ // Check

*/
function googleplusone(_ref24) {
var homepage = _ref24.homepage;
function googleplusone(_ref27) {
var homepage = _ref27.homepage;

@@ -626,4 +696,4 @@ // Check

*/
function redditsubmit(_ref25) {
var homepage = _ref25.homepage;
function redditsubmit(_ref28) {
var homepage = _ref28.homepage;

@@ -645,4 +715,4 @@ // Check

*/
function hackernewssubmit(_ref26) {
var homepage = _ref26.homepage;
function hackernewssubmit(_ref29) {
var homepage = _ref29.homepage;

@@ -665,5 +735,5 @@ // Check

*/
function facebooklike(_ref27) {
var homepage = _ref27.homepage;
var facebookApplicationID = _ref27.facebookApplicationID;
function facebooklike(_ref30) {
var homepage = _ref30.homepage,
facebookApplicationID = _ref30.facebookApplicationID;

@@ -688,5 +758,5 @@ // Prepare

*/
function facebookfollow(_ref28) {
var facebookUsername = _ref28.facebookUsername;
var facebookApplicationID = _ref28.facebookApplicationID;
function facebookfollow(_ref31) {
var facebookUsername = _ref31.facebookUsername,
facebookApplicationID = _ref31.facebookApplicationID;

@@ -710,4 +780,4 @@ // Prepare

*/
function twittertweet(_ref29) {
var twitterUsername = _ref29.twitterUsername;
function twittertweet(_ref32) {
var twitterUsername = _ref32.twitterUsername;

@@ -729,4 +799,4 @@ // Prepare

*/
function twitterfollow(_ref30) {
var twitterUsername = _ref30.twitterUsername;
function twitterfollow(_ref33) {
var twitterUsername = _ref33.twitterUsername;

@@ -748,4 +818,4 @@ // Prepare

*/
function githubfollow(_ref31) {
var githubUsername = _ref31.githubUsername;
function githubfollow(_ref34) {
var githubUsername = _ref34.githubUsername;

@@ -767,4 +837,4 @@ // Prepare

*/
function githubstar(_ref32) {
var githubSlug = _ref32.githubSlug;
function githubstar(_ref35) {
var githubSlug = _ref35.githubSlug;

@@ -792,6 +862,6 @@ // Prepare

*/
function quorafollow(_ref33) {
var quoraUsername = _ref33.quoraUsername;
var quoraRealname = _ref33.quoraRealname;
var quoraCode = _ref33.quoraCode;
function quorafollow(_ref36) {
var quoraUsername = _ref36.quoraUsername,
quoraRealname = _ref36.quoraRealname,
quoraCode = _ref36.quoraCode;

@@ -822,5 +892,8 @@ // Prepare

coveralls: coveralls,
codeclimate: codeclimate,
bithound: bithound,
waffle: waffle,
sixtydevstips: sixtydevstips,
patreon: patreon,
opencollective: opencollective,
gratipay: gratipay,

@@ -827,0 +900,0 @@ flattr: flattr,

'use strict';
// Import
var badges = require('./badges');

@@ -14,3 +15,3 @@

function renderBadge(badgeName) {
var config = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

@@ -45,4 +46,4 @@ if (badgeName === '---') {

function renderBadges(list) {
var config = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var options = arguments.length <= 2 || arguments[2] === undefined ? { filterCategory: false, filterScripts: true } : arguments[2];
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { filterCategory: false, filterScripts: true };

@@ -62,7 +63,19 @@ // Prepare

// Category?
if (options.filterCategory && (badgeName === '---' || options.filterCategory !== badges[badgeName].badgeCategory)) return;
// Seperator?
if (badgeName === '---') {
// Do not render seperators if we only wanted a single category
if (options.filterCategory) return;
}
// Exists?
else if (badges[badgeName]) {
// Category?
if (options.filterCategory && options.filterCategory !== badges[badgeName].badgeCategory) return;
// Script?
if (options.filterScripts === true && badgeName !== '---' && badges[badgeName].badgeScript) return;
// Script?
if (options.filterScripts && badges[badgeName].badgeScript) return;
}
// Doesn't exist
else {
throw new Error('the badge ' + badgeName + ' does not exist');
}

@@ -69,0 +82,0 @@ // Render

# History
## v1.2.2 2017 January 26
- Added [Open Collective](https://opencollective.com) badge
- Added [Code Climate](https://codeclimate.com) Rating badge
- Added [BitHound](https://bithound.io) Score badge
- Fix the error `TypeError: Cannot read property 'badgeScript' of undefined` which appeared under certain circumstances
## v1.2.1 2016 September 19

@@ -4,0 +10,0 @@ - Added `nodeico` badge

@@ -1,3 +0,5 @@

// 2016 March 8
// 2016 December 29
// https://github.com/bevry/editions
'use strict'
module.exports = require('editions').requirePackage(__dirname, require)
{
"name": "badges",
"version": "1.2.1",
"version": "1.2.2",
"description": "The definitive collection of badges for rendering",

@@ -60,3 +60,5 @@ "homepage": "https://github.com/bevry/badges",

"tips",
"star"
"star",
"opencollective",
"open collective"
],

@@ -73,2 +75,3 @@ "badges": {

"patreon",
"opencollective",
"gratipay",

@@ -82,2 +85,3 @@ "flattr",

"patreonUsername": "bevry",
"opencollectiveUsername": "bevry",
"gratipayUsername": "bevry",

@@ -96,3 +100,4 @@ "flattrUsername": "balupton",

"contributors": [
"Benjamin Lupton <b@lupton.cc> (http://balupton.com)"
"Benjamin Lupton <b@lupton.cc> (http://balupton.com)",
"Richard Walker <digitalsadhu@gmail.com> (http://lovebeer.nz/)"
],

@@ -107,3 +112,3 @@ "bugs": {

"engines": {
"node": ">=0.12"
"node": ">=0.8"
},

@@ -113,3 +118,3 @@ "editions": [

"description": "Source + ESNext + Require",
"entry": "source/index.js",
"entry": "index.js",
"directory": "source",

@@ -129,3 +134,3 @@ "syntaxes": [

"description": "Babel Compiled + ES2015 + Require",
"entry": "es2015/index.js",
"entry": "index.js",
"directory": "es2015",

@@ -142,30 +147,32 @@ "syntaxes": [

"dependencies": {
"editions": "^1.1.1"
"editions": "^1.3.3"
},
"devDependencies": {
"assert-helpers": "^4.2.0",
"babel-cli": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
"eslint": "^2.10.2",
"eslint-plugin-babel": "^3.2.0",
"joe": "^1.6.0",
"joe-reporter-console": "^1.2.1",
"projectz": "^1.1.5"
"assert-helpers": "^4.4.0",
"babel-cli": "^6.22.2",
"babel-preset-es2015": "^6.22.0",
"documentation": "^4.0.0-beta.18",
"eslint": "^3.14.1",
"joe": "^2.0.2",
"joe-reporter-console": "^2.0.1",
"projectz": "^1.3.2"
},
"scripts": {
"setup": "npm install",
"clean": "rm -Rf ./docs ./es2015",
"compile": "npm run compile:es2015",
"compile:es2015": "babel ./source --out-dir ./es2015 --presets es2015",
"meta": "npm run meta:projectz",
"meta:projectz": "projectz compile",
"prepare": "npm run compile && npm run test && npm run meta",
"release": "npm run prepare && npm run release:publish && npm run release:tag && npm run release:push",
"release:publish": "npm publish",
"release:tag": "git tag v$npm_package_version -a",
"release:push": "git push origin master && git push origin --tags",
"pretest": "npm run test:eslint",
"test:eslint": "eslint ./source",
"test": "node --harmony -e \"require('editions').requirePackage(process.cwd(), require, 'test.js')\""
"our:setup": "npm install",
"our:clean": "rm -Rf ./docs ./es2015",
"our:compile": "npm run our:compile:es2015",
"our:compile:es2015": "babel ./source --out-dir ./es2015 --presets es2015",
"our:meta": "npm run our:meta:docs && npm run our:meta:projectz",
"our:meta:docs": "documentation build -f html -o ./docs -g --shallow ./source/**.js",
"our:meta:projectz": "projectz compile",
"our:verify": "npm run our:verify:eslint",
"our:verify:eslint": "eslint --fix ./source",
"our:test": "npm run our:verify && npm test",
"our:release": "npm run our:release:prepare && npm run our:release:publish && npm run our:release:tag && npm run our:release:push",
"our:release:prepare": "npm run our:clean && npm run our:compile && npm run our:test && npm run our:meta",
"our:release:publish": "npm publish",
"our:release:tag": "git tag v$npm_package_version -a",
"our:release:push": "git push origin master && git push origin --tags",
"test": "node --harmony ./test.js --joe-reporter=console"
}
}

@@ -17,3 +17,4 @@ <!-- TITLE/ -->

<span class="badge-slackin"><a href="https://slack.bevry.me" title="Join this project's slack community"><img src="https://slack.bevry.me/badge.svg" alt="Slack community badge" /></a></span>
<span class="badge-patreon"><a href="http://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
<span class="badge-patreon"><a href="https://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
<span class="badge-opencollective"><a href="https://opencollective.com/bevry" title="Donate to this project using Open Collective"><img src="https://img.shields.io/badge/open%20collective-donate-yellow.svg" alt="Open Collective donate button" /></a></span>
<span class="badge-gratipay"><a href="https://www.gratipay.com/bevry" title="Donate weekly to this project using Gratipay"><img src="https://img.shields.io/badge/gratipay-donate-yellow.svg" alt="Gratipay donate button" /></a></span>

@@ -46,3 +47,3 @@ <span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>

<li>Module: <code>require('badges')</code></li>
<li>CDN URL: <code>//wzrd.in/bundle/badges@1.2.1</code></li></ul>
<li>CDN URL: <code>//wzrd.in/bundle/badges@1.2.2</code></li></ul>

@@ -71,44 +72,49 @@ <a href="http://enderjs.com" title="Ender is a full featured package manager for your browser"><h3>Ender</h3></a><ul>

const list = [
// Custom image badge, `url` and `title` are optional
['badge', {image: 'image url', alt: 'image alt text', url: 'target url', title: 'title for mouseover'}],
// Custom shields.io badge, for options see the "Your Badge" section at the bottom of: http://shields.io
['shields', {left: 'subject', right: 'status', color: 'red', alt: 'badge alt text', url: 'target url', title: 'title for mouseover'}],
'---',
// Development Badges
'npmversion',
'npmdownloads',
'daviddm',
'daviddmdev',
'---',
// Testing Badges
'saucelabsbm',
'saucelabs',
'travisci',
'codeship',
'coveralls',
'waffle',
'---',
// Funding Badges
'sixtydevstips',
'patreon',
'gratipay',
'flattr',
'paypal',
'bitcoin',
'wishlist',
'---',
// Social Badges
'slackinscript',
'slackin',
'gabeacon',
'googleplusone',
'redditsubmit',
'hackernewssubmit',
'facebooklike',
'facebookfollow',
'twittertweet',
'twitterfollow',
'githubfollow',
'githubstar',
'quorafollow'
// Custom Badges
['badge', {image: 'image', alt: 'alt'}],
['badge', {image: 'image', alt: 'alt', url: 'url', title: 'title'}],
['shields', {left: 'left', right: 'right', alt: 'alt', url: 'url', title: 'title'}],
['shields', {left: 'left', right: 'right', color: 'red', alt: 'alt', url: 'url', title: 'title'}],
'---',
// Development Badges
'npmversion',
'npmdownloads',
'daviddm',
'daviddmdev',
'nodeico',
'---',
// Testing Badges
'saucelabsbm',
'saucelabs',
'travisci',
'codeship',
'coveralls',
'codeclimate',
'bithound',
'waffle',
'---',
// Funding Badges
'sixtydevstips',
'patreon',
'opencollective',
'gratipay',
'flattr',
'paypal',
'bitcoin',
'wishlist',
'---',
// Social Badges
'slackinscript',
'slackin',
'gabeacon',
'googleplusone',
'redditsubmit',
'hackernewssubmit',
'facebooklike',
'facebookfollow',
'twittertweet',
'twitterfollow',
'githubfollow',
'githubstar',
'quorafollow'
]

@@ -118,31 +124,31 @@

const config = {
npmPackageName: 'getbadges',
npmPackageName: 'badges',
saucelabsUsername: 'bevry',
saucelabsAuthToken: '123',
codeshipProjectUUID: '123',
codeshipProjectID: '123',
githubSlug: 'bevry/getbadges',
saucelabsUsername: 'bevry',
saucelabsAuthToken: '123',
codeshipProjectUUID: '123',
codeshipProjectID: '123',
githubSlug: 'bevry/badges',
nodeicoQueryString: {downloads: true, compact: true, height: 2},
sixtydevstipsID: 'd2dcf439c9759e88f3ccec1cef394c10',
patreonUsername: 'bevry',
gratipayUsername: 'bevry',
flattrCode: '344188/balupton-on-Flattr',
flattrUsername: 'balupton',
flattrURL: 'https://flattr.com/profile/balupton',
paypalURL: 'https://paypal.me/bevry',
paypalButtonID: 'QB8GQPZAH84N6', // another option instead of paypalURL
paypalUsername: 'bevry', // another option instead of paypalURL
bitcoinURL: 'https://bevry.me/bitcoin',
wishlistURL: 'https://bevry.me/wishlist',
sixtydevstipsID: 'd2dcf439c9759e88f3ccec1cef394c10',
patreonUsername: 'bevry',
opencollectiveUsername: 'bevry',
gratipayUsername: 'bevry',
flattrUsername: 'balupton',
paypalURL: 'https://paypal.me/bevry',
paypalButtonID: 'QB8GQPZAH84N6', // another option instead of paypalURL
paypalUsername: 'bevry', // another option instead of paypalURL
bitcoinURL: 'https://bevry.me/bitcoin',
wishlistURL: 'https://bevry.me/wishlist',
slackinURL: 'https://slack.bevry.me',
gaTrackingID: 'UA-XXXXX-XX',
homepage: 'http://bevry.me',
facebookApplicationID: '123123',
facebookUsername: 'balupton',
twitterUsername: 'bevryme',
githubUsername: 'balupton',
quoraUsername: 'Benjamin-Lupton',
quoraRealname: 'Benjamin Arthur Lupton', // optional, will extract from username
slackinURL: 'https://slack.bevry.me',
gaTrackingID: 'UA-XXXXX-XX',
homepage: 'http://bevry.me',
facebookApplicationID: '123123',
facebookUsername: 'balupton',
twitterUsername: 'bevryme',
githubUsername: 'balupton',
quoraUsername: 'Benjamin-Lupton',
quoraRealname: 'Benjamin Arthur Lupton' // optional, will extract from username
}

@@ -170,3 +176,7 @@

If you want to render badges inside your own project's readme files, check out the meta builder [projectz](https://github.com/bevry/projectz) which uses this package for badge rendering.
[Complete badge configuration available to you can be found here.](http://rawgit.com/bevry/bdages/master/docs/)
<!-- HISTORY/ -->

@@ -196,5 +206,6 @@

1. If your badge requires a script to run, it should have `badgeScript = true` - see other badges for an example
2. [Also remember to export your badge.](https://github.com/bevry/badges/blob/0b4aab710fc676f635e49e702960db0d151a12d5/source/badges.js#L667-L668)
2. [Also remember to export your badge](https://github.com/bevry/badges/blob/0b4aab710fc676f635e49e702960db0d151a12d5/source/badges.js#L667-L668)
2. [Add the badges test data to the test file `source/test.js`](https://github.com/bevry/badges/blob/master/source/test.js)
3. [Add the badge configuration information to this readme file `README.md`](https://github.com/bevry/badges/blob/master/README.md)
4. [Add the badge name to the `keyword` field of `package.json`](https://github.com/bevry/badges/blob/master/package.json)

@@ -218,3 +229,4 @@ These changes can be done in multiple commits or the same, it doesn't matter, as we will squash the commits on merge. We will also the changelog entry, so you don't need to do.

<span class="badge-patreon"><a href="http://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
<span class="badge-patreon"><a href="https://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
<span class="badge-opencollective"><a href="https://opencollective.com/bevry" title="Donate to this project using Open Collective"><img src="https://img.shields.io/badge/open%20collective-donate-yellow.svg" alt="Open Collective donate button" /></a></span>
<span class="badge-gratipay"><a href="https://www.gratipay.com/bevry" title="Donate weekly to this project using Gratipay"><img src="https://img.shields.io/badge/gratipay-donate-yellow.svg" alt="Gratipay donate button" /></a></span>

@@ -230,3 +242,4 @@ <span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>

<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/badges/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/badges">view contributions</a></li></ul>
<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/badges/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/badges">view contributions</a></li>
<li><a href="http://lovebeer.nz/">Richard Walker</a> — <a href="https://github.com/bevry/badges/commits?author=digitalsadhu" title="View the GitHub contributions of Richard Walker on repository bevry/badges">view contributions</a></li></ul>

@@ -233,0 +246,0 @@ <a href="https://github.com/bevry/badges/blob/master/CONTRIBUTING.md#files">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a>

@@ -0,1 +1,4 @@

'use strict'
// Import
const querystring = require('querystring')

@@ -257,3 +260,3 @@

const url = `https://coveralls.io/r/${githubSlug}`
const alt = 'Coverage Status'
const alt = 'Coveralls Coverage Status'
const title = "View this project's coverage on Coveralls"

@@ -265,2 +268,40 @@ return badge({image, alt, url, title})

/**
Code Climate Rating Badge
@method codeclimate
@param {String} config.githubSlug The github slug that the project lives at (e.g. bevry/badges)
@return {String} the result badge
*/
function codeclimate ({githubSlug}) {
// Check
if ( !githubSlug ) throw new Error('githubSlug is missing')
// Create
const image = `https://img.shields.io/codeclimate/github/${githubSlug}.svg`
const url = `https://codeclimate.com/github/${githubSlug}`
const alt = 'Code Climate Rating'
const title = "View this project's rating on Code Climate"
return badge({image, alt, url, title})
}
codeclimate.badgeCategory = 'testing'
/**
BitHound Score Badge
@method bithound
@param {String} config.githubSlug The github slug that the project lives at (e.g. bevry/badges)
@return {String} the result badge
*/
function bithound ({githubSlug}) {
// Check
if ( !githubSlug ) throw new Error('githubSlug is missing')
// Create
const image = `https://bithound.io/github/${githubSlug}/badges/score.svg`
const url = `https://bithound.io/github/${githubSlug}`
const alt = 'BitHound Score'
const title = "View this project's score on BitHound"
return badge({image, alt, url, title})
}
bithound.badgeCategory = 'testing'
/**
Waffle Badge

@@ -315,4 +356,4 @@ @method waffle

@method patreon
@param {String} config.patreonUsername The patreon username to donate to
@param {String} config.patreonURL The url to the patreon donate page
@param {String} config.patreonUsername The Patreon username to donate to
@param {String} config.patreonURL The url to the Patreon donate page
@return {String} the result badge

@@ -324,3 +365,3 @@ */

if ( !patreonUsername ) throw new Error('patreonUsername is missing')
patreonURL = `http://patreon.com/${patreonUsername}`
patreonURL = `https://patreon.com/${patreonUsername}`
}

@@ -338,6 +379,29 @@

/**
Open Collective Badge
@method patreon
@param {String} config.opencollectiveUsername The Open Collective username to donate to
@param {String} config.opencollectiveURL The url to the Open Collective donate page
@return {String} the result badge
*/
function opencollective ({opencollectiveUsername, opencollectiveURL}) {
// Check
if ( !opencollectiveURL ) {
if ( !opencollectiveUsername ) throw new Error('opencollectiveUsername is missing')
opencollectiveURL = `https://opencollective.com/${opencollectiveUsername}`
}
// Create
const image = 'https://img.shields.io/badge/open%20collective-donate-yellow.svg'
const url = opencollectiveURL
const alt = 'Open Collective donate button'
const title = 'Donate to this project using Open Collective'
return badge({image, alt, url, title})
}
opencollective.badgeCategory = 'funding'
/**
Gratipay Badge
@method gratipay
@param {String} config.gratipayUsername The gratipay username to donate to
@param {String} config.gratipayURL The url to the gratipay donate page
@param {String} config.gratipayUsername The Gratipay username to donate to
@param {String} config.gratipayURL The url to the Gratipay donate page
@return {String} the result badge

@@ -364,4 +428,4 @@ */

@method flattr
@param {String} config.flattrCode The flattr code to donate to (e.g. 344188/balupton-on-Flattr)
@param {String} config.flattrUsername The flattr username to donate to (e.g. balupton)
@param {String} config.flattrCode The Flattr code to donate to (e.g. 344188/balupton-on-Flattr)
@param {String} config.flattrUsername The Flattr username to donate to (e.g. balupton)
@param {String} config.flattrURL The url to the flattr donate page

@@ -397,4 +461,4 @@ @return {String} the result badge

@param {String} config.paypalURL The url to the paypal donate page
@param {String} config.paypalButtonID The paypal button id
@param {String} config.paypalUsername The paypal.me username
@param {String} config.paypalButtonID The Paypal button id
@param {String} config.paypalUsername The Paypal.me username
@return {String} the result badge

@@ -715,5 +779,8 @@ */

coveralls,
codeclimate,
bithound,
waffle,
sixtydevstips,
patreon,
opencollective,
gratipay,

@@ -720,0 +787,0 @@ flattr,

@@ -0,1 +1,3 @@

'use strict'
// Import

@@ -53,7 +55,19 @@ const badges = require('./badges')

// Category?
if ( options.filterCategory && (badgeName === '---' || options.filterCategory !== badges[badgeName].badgeCategory) ) return
// Seperator?
if ( badgeName === '---' ) {
// Do not render seperators if we only wanted a single category
if ( options.filterCategory ) return
}
// Exists?
else if ( badges[badgeName] ) {
// Category?
if ( options.filterCategory && options.filterCategory !== badges[badgeName].badgeCategory ) return
// Script?
if ( options.filterScripts === true && badgeName !== '---' && badges[badgeName].badgeScript ) return
// Script?
if ( options.filterScripts && badges[badgeName].badgeScript ) return
}
// Doesn't exist
else {
throw new Error(`the badge ${badgeName} does not exist`)
}

@@ -60,0 +74,0 @@ // Render

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc