Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/egoist/version-badge

Display a version badge.
https://github.com/egoist/version-badge

Last synced: 22 days ago
JSON representation

Display a version badge.

Awesome Lists containing this project

README

        

# version-badge ![version badge](https://version-badge.egoist.sh/github/egoist/version-badge)

> Display a version badge.

## What?

Designed to be put right next to your project title:

```markdown
# chalk ![version badge](https://version-badge.egoist.sh/npm/chalk)
```

See the title of this README to get the idea :)

Of course you can link the svg to anywhere like the npm page:

```markdown
# chalk [![version badge](version-badge.egoist.sh/npm/chalk)](https://npmjs.com/package/chalk)
```

> **Note:** To make this service keep working, you can [donate](https://github.com/egoist/donate) to support my work.

## Usage

### npm

GET `/npm/:name`

Query:

- `tag`: Default `latest`. Release tag, eg: `beta`

Examples:

- https://version-badge.egoist.sh/npm/vue
- https://version-badge.egoist.sh/npm/webpack
- https://version-badge.egoist.sh/npm/poi?tag=next

### github

Directly get the version from a file that's hosted on GitHub:

GET `/github/:owner/:repo`

Alias `/gh/:owner/:repo`

Query:

- `file`: Default `package.json`
- `field`: Default `version`
- `branch`: Default `master`

Examples:

- https://version-badge.egoist.sh/github/zeit/next.js
- https://version-badge.egoist.sh/github/facebookincubator/create-react-app?file=packages/create-react-app/package.json

### rust crate

GET `/crate/:name`

Examples:

- https://version-badge.egoist.sh/crate/rand
- https://version-badge.egoist.sh/crate/clap

### text

GET `/text?text=random_text`

Examples:

- https://version-badge.egoist.sh/text?text=beta
- https://version-badge.egoist.sh/text?text=coming%20soon

## Prior Art

I made this service because following one does not support npm (directly) and mono repos.

- [npm-version-badge](https://github.com/teelaunch/npm-version-badge)

## License

MIT © [EGOIST](github.com/EGOIST)