@cnocon/github-stats-card

A stats card for GitHub metrics.

Usage no npm install needed!

<script type="module">
  import cnoconGithubStatsCard from 'https://cdn.skypack.dev/@cnocon/github-stats-card';
</script>

README

GitHub Stats Card

Pass in a minimum of your GitHub access token and a GitHub username and get this:

Widget Screenshot

Installation

npm install @cnocon/github-stats-card

Example using Express:

The Card function returns an HTML string you can append anywhere. The first argument is the GitHub username, the second is your GitHub access token, and the third is an optional Boolean for whether or not you want to style the card with the included theme. Defaults to false.

const { Card } = require('@cnocon/github-stats-card');

// ...
app.get('/', async (req, res) => {
  const statsCard = await Card('cnocon', process.env.GITHUB_ACCESS_TOKEN, true);
  res.send(statsCard);
});