GitHub contributors table generator
Powers the contributors-table.vercel.app π
- βοΈ Flexible settings
- π Hyperlinks to contributors profiles
- π‘ Hints when hovering over an avatar
- π¨ Customizable
- π€ Images supported by Markdown on GitHub and anywhere!
npm install contributors-table
# If you are using Bun
bun install contributors-table
import { generateContributorsTable } from 'contributors-table'
import { Octokit } from '@octokit/core'
const octokit = new Octokit()
const contributorsList = await octokit.request(
'GET /repos/{owner}/{repo}/contributors',
{
owner: 'octocat',
repo: 'Hello-World'
}
)
const image = generateContributorsTable(contributorsList.data)
// <svg>...</svg>
// Generate a PNG image
generateContributorsTable(..., { format: 'png' })
generateContributorsTable(..., {
// The width of the avatars
width: 60,
// Gap between avatars
gap: 10,
// The number of avatars per row
columns: 10,
// Number of rows
rows: 7,
// The roundness of the avatars
roundness: 50,
// Stroke around avatars
strokeWith: 0.8,
// Whether to render avatars on the server side.
// If false - then the browser itself downloads images from GitHub
// If true - then the script takes care of downloading avatars and embedding them
// Always `true` if `format` != `'svg'`
ssr: true
})
Thank you for considering contributing to contributors-table π! Please read the CONTRIBUTING.md file for more information about how to contribute to this project.
If you like this project, consider supporting it by starring β it on GitHub, sharing it with your friends, or buying me a coffee β
This project is licensed under the MIT License - see the LICENSE file for details.