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

repository-provider

Package Overview
Dependencies
Maintainers
1
Versions
662
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repository-provider

abstract interface to git repository providers like github bitbucket

  • 2.8.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
708
decreased by-28.27%
Maintainers
1
Weekly downloads
 
Created
Source

npm Greenkeeper semantic-release styled with prettier Build Status bithound codecov.io Coverage Status Known Vulnerabilities GitHub Issues Stories in Ready Dependency Status devDependency Status docs XO code style downloads Commitizen friendly

repository-provider

abstract interface to git repository providers like github bitbucket

Example

import { GithubProvider } from 'repository-provider';

const provider = new GithubProvider({ token: 'xxx' });

const repository = await provider.repository('myuser/myrepo');
const branch = await repository.branch('master');
const files = await branch.list();

API

Table of Contents

Content

Type: Object

Properties

Provider

Base repository provider acts as a source of repositories

Parameters

Properties

repositoryClass

Returns Class repository class used by the Provider

branchClass

Returns Class branch class used by the Provider

pullRequestClass

Returns Class pull request class used by the Provider

createRepository

Create a new repository

Parameters

  • name
  • options

Returns Promise<Repository>

repository

Lookup a repository

Parameters

Returns Promise<Repository>

branch

Lookup a branch First lookup repository then the branch If no branch was specified then the default branch will be delivered.

Parameters

Returns Promise<Branch>

rateLimitReached

Is our rate limit reached. By default we have no rate limit

Returns boolean always false

type

Deliver the repository type

Returns string 'git'

defaultOptions

Default configuration options

Returns Object

options

Pepare configuration by mixing together defaultOptions with actual options

Parameters

Returns Object combined options

Branch

Abstract git branch

Parameters

Properties

initialize

called one after constructing

Returns Promise

provider

Returns Provider

fullName

Deliver repository and branch name combined

Returns string 'repo#branch'

delete

Delete the branch from the Repository.

Returns Promise

content

Deliver file content

Parameters

Returns Promise<Content> content of a given file

commit

Commit files

Parameters

Returns Promise

createPullRequest

Create a pull request

Parameters

Returns Promise

list

File list

rateLimitReached

Value delivered from the provider

Returns boolean providers rateLimitReached

rateLimitReached

forward to the Provider

Parameters

Repository

Abstract repository

Parameters

Properties

initialize

called one after constructing

Returns Promise

content

Lookup content form the default branch

Parameters

  • args ...any

Returns Content

urls

Deliver urls to access the repo

Returns Array<string>

branch

Lookup branch by name

Parameters

Returns Promise<Branch>

defaultBranch

Lookup the default branch

Returns Promise<Branch> 'master' branch

branches

Returns Promise<Map> of all branches

createBranch

Create a new Branch by cloning a given source branch

Parameters

Returns Promise<Branch> newly created branch

deleteBranch

Delete a Branch

Parameters

Returns Promise<undefined>

addBranch

Add a branch

Parameters

Returns Promise

pullRequests

Deliver all @{link PullRequest}s

Returns Promise<Map> of all pull requests

pullRequest

Deliver @{link PullRequest} for a given name

Parameters

Returns Promise<PullRequest>

addPullRequest

Add a pull request

Parameters

Returns Promise

deletePullRequest

Delete a PullRequest

Parameters

Returns Promise

rateLimitReached

Value delivered from the provider

Returns boolean providers rateLimitReached

rateLimitReached

forward to the Provider

Parameters

PullRequest

Abstract pull request

Parameters

Properties

provider

Returns Provider

delete

Delete the pull request from the Repository.

Returns Promise

install

With npm do:

npm install repository-provider

license

BSD-2-Clause

Keywords

FAQs

Package last updated on 15 Jan 2018

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