0.0.32 • Published 5 years ago

ts-github-projects v0.0.32

Weekly downloads
3
License
MIT License
Repository
github
Last release
5 years ago

This is a simple library to manage GitHub Projects easily. This supports to create a project, column, card, update them, show them, delete them, etc... The library is built with GitHub REST API v3.

Install

# with npm
npm install ts-github-projects

# with yarn
yarn add ts-github-projects

Features

Utilities

  • rate limit

Projects

  • create a repository project
  • create an organization project
  • create a user project
  • get a project
  • list repository's projects
  • list organization's projects
  • list user's projects
  • update a project
  • delete a project

Columns

  • crate a column
  • get a column
  • list columns
  • update a column
  • delete a column
  • move a column

Cards

  • crate a card
    • associate with issue
    • associate with pull request
  • get a card
  • list cards
  • update a card
  • delete a card
  • move a card

Collaborators

  • list collaborators
  • review a user's permission level
  • add user as a collaborator
  • remove user as a collaborator

Usage

For GitHub API v3 requests using OAuth, you can make up to 5000 requests per hour. For unauthenticated requests, the rate limit allows for up to 60 requests per hour. (Rate limiting - GitHub Developer)

I recommend you to use OAuth.

How to authorize with GitHub Personal Access Token

  1. Create a personal access token (Creating a personal access token for the command line - GitHub Help)

  2. Make .env file in the root directory of your project and set the token. For example:

    PERSONAL_ACCESS_TOKEN=<personal_access_token>
  3. You can access it with process.env.PERSONAL_ACCESS_TOKEN (motdotla/dotenv)

    import TsGitHubProjects from "ts-github-projects";
    
    const gh = new TsGitHubProjects({
      token: process.env.PERSONAL_ACCESS_TOKEN!,
    });
  4. Don't forget to add .env to your .gitignore file.

Examples

import TsGitHubProjects from "ts-github-projects";

const gh = new TsGitHubProjects({ token: process.env.PERSONAL_ACCESS_TOKEN! });

// list projects
const projectsList = await gh.listUserProjects("username");

// create a project
const project = await gh.createUserProject({
  name: "My ToDo List",
  body: "description of the project",
});

// create a column
const column = await gh.createColumn(project?.id, {
  name: "ToDo",
});
0.0.32

5 years ago

0.0.31

5 years ago

0.0.30

5 years ago

0.0.28

5 years ago

0.0.29

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.20

5 years ago

0.0.21

5 years ago

0.0.22

5 years ago

0.0.14

5 years ago

0.0.15

5 years ago

0.0.16

5 years ago

0.0.17

5 years ago

0.0.18

5 years ago

0.0.19

5 years ago

0.0.12

5 years ago

0.0.13

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago