# github-commit-calendar

> A Svelte component to display a GitHub user's commit calendar

Latest version **1.1.0** (published 2023-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install github-commit-calendar
pnpm add github-commit-calendar
yarn add github-commit-calendar
bun add github-commit-calendar
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2023-04-11 |
| First published | 2023-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 2 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Dylan Dupasquier dylandupasquier@gmail.com |
| Maintainers | dupasquier |
| Keywords | svelte, component, web component, github, commit, calendar |

## Links

- npm: https://www.npmjs.com/package/github-commit-calendar
- Repository: https://github.com/Ddupasquier/githubCommits
- Homepage: https://github.com/Ddupasquier/githubCommits#readme
- Issues: https://github.com/Ddupasquier/githubCommits/issues
- npm.io page: https://npm.io/package/github-commit-calendar

## Dependencies (2)

- [mysvelte-ui](https://npm.io/package/mysvelte-ui.md) ^0.0.21+latest
- [graphql-request](https://npm.io/package/graphql-request.md) ^5.2.0

## Recent versions

- 1.1.0 (latest) — 2023-04-11
- 1.0.0 — 2023-04-10
- 0.0.13 — 2023-04-10
- 0.0.12 — 2023-04-08
- 0.0.11 — 2023-04-08
- 0.0.10 — 2023-04-08
- 0.0.9 — 2023-04-08
- 0.0.8 — 2023-04-08
- 0.0.7 — 2023-04-08
- 0.0.6 — 2023-04-08
- 0.0.5 — 2023-04-08
- 0.0.4 — 2023-04-08
- 0.0.3 — 2023-04-07
- 0.0.2 — 2023-04-07
- 0.0.1 — 2023-04-07

## README

# Github Commit Calendar

<img src="https://user-images.githubusercontent.com/89223122/231030957-6a4a6362-5fea-4628-8356-4355072947b7.png" width="100%" alt="github-commit-calendar" />

[![npm version](https://badge.fury.io/js/github-commit-calendar.svg)](https://badge.fury.io/js/github-commit-calendar) 🔥 
[![npm](https://img.shields.io/npm/dw/github-commit-calendar)](https://npmjs.com/package/github-commit-calendar) ⭐️ 
[![Downloads](https://img.shields.io/npm/dt/github-commit-calendar.svg)](https://www.npmjs.com/package/github-commit-calendar) 🚀 
[![GitHub Stars](https://img.shields.io/github/stars/Ddupasquier/githubCommits?style=social)](https://github.com/Ddupasquier/githubCommits/stargazers) 😎 
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/) 💖 
[![Platform support](https://img.shields.io/badge/Platform%20support-%20Svelte-green.svg)](https://github.com/Ddupasquier/githubCommits) 🛠️


A Svelte component that displays a user's GitHub commit history as a calendar. You can customize the appearance of the calendar using the available props.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Props](#props)
- [About](#about)

## Installation

```bash
npm install github-commit-calendar
```

## Usage

Import the component and use it in your Svelte application:

```js
<script>
  import { GithubCommitCalendar } from "github-commit-calendar";
</script>

<GithubCommitCalendar gitToken={your_github_token} />
```



### Obtaining a GitHub Token

To use this component, you need a GitHub token with minimal permissions. Follow these steps to generate a token:
<ol>

<li>Go to your <a href="https://github.com/settings/tokens">Github Settings</a></li>

<li>Click on "Generate new token"</li>

<li>Give the token a description and only select the "public_repo" scope.</li>

<li>Click "Generate token"</li>

<li>Copy the generated token and pass it as the gitToken prop to the component.</li>
</ol>

<b>Note: Keep your token secure and do not share it publicly. 🚨</b>



### Props

| Prop         | Type                  | Default                   | Description                                              |
| ------------ | --------------------- | ------------------------- | -------------------------------------------------------- |
| gitToken     | string                | -                         | **Required**. Your GitHub token with "public_repo" scope.|
| color        | string                | 'rgba(187, 53, 220)'      | The color of the commit bars.                            |
| size         | 'small', 'medium', 'large', number | 'medium'     | The size of the commit bars. The value can either be a string of the specific size, or it can be a number in px.                                                                                   |
| background   | string                | 'rgba(187, 53, 220, .1)'  | The background color of the calendar.                    |
| gap          | number                | 2                         | The gap between each cell in px.                         |
| hover        | boolean               | false                     | The hover animation of the calendar.                     |
| key          | boolean               | true                      | Key to be shown or not shown.                            | 
| months       | boolean               | true                      | Months to be shown or not shown.                         |
| weekdays     | boolean               | true                      | Weekdays to be shown or not shown.                       |



### Rest Props

Any additional props will be passed down to the top-level div element of the component. This can be useful for adding custom styles or attributes.

```js
<GithubCommitCalendar gitToken={your_github_token} id="custom-id" style="custom styles" />
```



## About

### The Project

This project aims to provide a simple, customizable Svelte component for visualizing GitHub commit history. It was designed to be lightweight and easy to integrate into any Svelte application.

---
_Source: https://npm.io/package/github-commit-calendar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
