Check if url
is a badge. Supports shields.io, travis-ci,
david-dm, nodei.co, and inch-ci.
npm:
npm install is-badge
is-badge is also available for bower, component, duo, and for AMD, CommonJS, and globals (uncompressed and compressed).
var isBadge = require('is-badge');
isBadge('https://img.shields.io/travis/joyent/node.svg'); // true
isBadge('http://example.com'); // false
isBadge(true); // [Error: is-badge expected string]
Check if url
is a badge.
Parameters:
url
(string
) — May or may not be a badge.
Returns: boolean
— Whether or not url
is a badge.
Throws: Error
— When url
is not a string.