is-badge

Check if `url` is a badge

Usage no npm install needed!

<script type="module">
  import isBadge from 'https://cdn.skypack.dev/is-badge';
</script>

README

is-badge

Build Coverage Downloads Size

Check if url is a badge.

Supports:

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install is-badge

Use

import {isBadge} from 'is-badge'

isBadge('https://img.shields.io/travis/joyent/node.svg') // => true
isBadge('https://example.com') // => false
isBadge(true) // [Error: is-badge expected string]

API

This package exports the following identifiers: isBadge. There is no default export.

isBadge(url)

Check if url is a badge.

License

MIT © Titus Wormer