contributors-table
TypeScript icon, indicating that this package has built-in type declarations

1.2.1Β β€’Β PublicΒ β€’Β Published

contributors-table

NPM Version Tests Status Built with Bun Formatted with Biome

GitHub contributors table generator

Powers the contributors-table.vercel.app 😎

✨ Features

  • βš™οΈ Flexible settings
  • πŸ”— Hyperlinks to contributors profiles
  • πŸ’‘ Hints when hovering over an avatar
  • 🎨 Customizable
  • 🀝 Images supported by Markdown on GitHub and anywhere!

πŸ“¦ Installation

npm install contributors-table
# If you are using Bun
bun install contributors-table

πŸš€ Usage

Basic Usage

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>

🏞️ An example of an image

Contributor Table Example

Advanced Usage

Use another image format

// Generate a PNG image
generateContributorsTable(..., { format: 'png' })

Customize the table

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
})

🀝 Contributing

Thank you for considering contributing to contributors-table πŸ˜€! Please read the CONTRIBUTING.md file for more information about how to contribute to this project.

❀️ Support

If you like this project, consider supporting it by starring ⭐ it on GitHub, sharing it with your friends, or buying me a coffee β˜•

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

Package Sidebar

Install

npm i contributors-table

Weekly Downloads

2

Version

1.2.1

License

MIT

Unpacked Size

17.7 kB

Total Files

6

Last publish

Collaborators

  • okinea