is-badge
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

is-badge

Build Coverage Downloads Size

Check if url is a badge.

Contents

What is this?

This is a tiny package that checks if a given url points to a badge.

When should I use this?

You can use this package for example to filter out badges.

Install

This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:

npm install is-badge

In Deno with esm.sh:

import {isBadge} from 'https://esm.sh/is-badge@2'

In browsers with esm.sh:

<script type="module">
  import {isBadge} from 'https://esm.sh/is-badge@2?bundle'
</script>

Use

import {isBadge} from 'is-badge'

isBadge('https://img.shields.io/travis/joyent/node.svg') // => true
isBadge('https://example.com') // => false

API

This package exports the identifier isBadge. There is no default export.

isBadge(url)

Check if url is a badge.

Data

This project supports:

Types

This package is fully typed with TypeScript. It exports no additional types.

Compatibility

This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.

Contribute

Yes please! See How to Contribute to Open Source.

Security

This package is safe.

License

MIT © Titus Wormer

Package Sidebar

Install

npm i is-badge

Weekly Downloads

186

Version

2.1.1

License

MIT

Unpacked Size

8.31 kB

Total Files

5

Last publish

Collaborators

  • wooorm