Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/rest

Package Overview
Dependencies
Maintainers
4
Versions
297
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/rest

GitHub REST API client for Node.js

  • 21.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.9M
decreased by-14.19%
Maintainers
4
Weekly downloads
 
Created

What is @octokit/rest?

The @octokit/rest npm package is a client library for accessing the GitHub REST API. It provides a convenient way to interact with GitHub resources such as repositories, issues, pull requests, and more, directly from your JavaScript code. It abstracts away the direct HTTP requests to GitHub, offering an easier and more intuitive way to access GitHub data and perform operations.

What are @octokit/rest's main functionalities?

Repository Management

This feature allows you to manage repositories. The code sample demonstrates how to create a new public repository for the authenticated user.

const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({ auth: 'personal-access-token' });
octokit.repos.createForAuthenticatedUser({
  name: 'new-repo',
  private: false
});

Issues Management

This feature enables you to manage issues in a repository. The code sample shows how to create a new issue in a specified repository.

const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({ auth: 'personal-access-token' });
octokit.issues.create({
  owner: 'username',
  repo: 'repository-name',
  title: 'New Issue Title',
  body: 'Description of the issue.'
});

Pull Requests

This feature allows for the creation and management of pull requests. The code sample illustrates how to create a pull request from one branch to another within the same repository.

const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({ auth: 'personal-access-token' });
octokit.pulls.create({
  owner: 'username',
  repo: 'repository-name',
  title: 'New Pull Request',
  head: 'branch-name',
  base: 'base-branch'
});

Other packages similar to @octokit/rest

Keywords

FAQs

Package last updated on 16 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc