Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
repository-provider
Advanced tools
abstract interface to git repository providers like github bitbucket
abstract interface to git repository providers like github bitbucket
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();
list by repository-provider keyword
Extends Owner
Base repository provider acts as a source of repositories
options
ObjectrepositoryGroups
Map<string, RepositoryGroup>config
ObjectLookup a repository group
name
string of the groupReturns Promise<RepositoryGroup>
Create a new repository group
Returns Promise<RepositoryGroup>
Lookup a repository in the provider and all of its repository groups
name
stringReturns Promise<Repository>
Returns Class repository group class used by the Provider
Returns Class pull request class used by the Provider
Is our rate limit reached. By default we have no rate limit
Returns boolean always false
Deliver the provider name
Returns string class name by default
we are our own provider
Returns Provider this
Default configuration options
Returns Object
Extract options suitable for the constructor form the given set of environment variables
env
ObjectReturns Object undefined if no suitable environment variables have been found
Pepare configuration by mixing together defaultOptions with actual options
config
Object raw configReturns Object combined options
Abstract branch
repository
Repositoryname
string (optional, default 'master'
)repository
Repositoryprovider
Providername
stringcalled once after constructing
Returns Promise
The provider we live in
Returns Provider
Branch owner By default we provide the repository owner
Returns string
Branch project By default we provide the repository project
Returns string
Repository and branch name combined
Returns string 'repo#branch'
Repository and branch name combined. But skipping the branch name if it is the default branch
Returns string 'repo#branch'
Deliver repository and branch url combined
Returns string 'repoUrl#branch'
Url of issue tracking system.
Returns string as provided from the repository
Url of home page.
Returns string as provided from the repository
Are we the default branch
Returns boolean true if name is 'master'
Delete the branch from the Repository.
Deliver file content
path
stringReturns Promise<Content> content of a given file
Commit files
Returns Promise
Create a pull request
Returns Promise<PullRequest>
File list
Returns Array<string> all file names in the branch
Value delivered from the provider
Returns boolean providers rateLimitReached
forward to the Provider
value
booleanCollection of repositories
repositories
Map<string, Repository>Returns Class repository class used by the Provider
Returns Class branch class used by the Provider
Returns Class content class used by the Provider
Delete a repository
name
stringLookup a repository
name
string of the repository may contain a #branchReturns Promise<Repository>
Create a new repository
Returns Promise<Repository>
Lookup a branch First lookup repository then the branch If no branch was specified then the default branch will be delivered.
name
string with optional branch name as '#myBranchName'Provider initialization will be called once before content addressing method is called
Deliver the repository type
Returns string 'git'
Abstract repository
the owners provider
Returns Provider
Called one after constructing
Lookup content form the default branch Branch#content
args
...anyReturns Content
urls to access the repo
preffered url to access the repo
Returns string
the url of issue tracking system.
Returns string
the url of home page.
Returns string
Repository owner Default implementation delivers undefined
Returns string undefined
Repository project Default implementation delivers undefined
Returns string undefined
Name without project / owner
Returns string name
Lookup branch by name
name
stringLookup the default branch
Returns Promise<Branch> 'master' branch
Returns Promise<Map> of all branches
Create a new Branch by cloning a given source branch
Returns Promise<Branch> newly created branch
Delete a Branch
name
stringAdd a branch
branch
BranchDelete the repository from the Provider. Provider#deleteRepository
Deliver all PullRequests
Returns Promise<Map> of all pull requests
The @{link PullRequest} for a given name
name
stringReturns Promise<PullRequest>
Add a pull request
pullRequest
PullRequestReturns Promise
Delete a PullRequest
name
stringReturns Promise
Returns string providers type
Value delivered from the provider
Returns boolean providers rateLimitReached
forward to the Provider
value
booleanAbstract pull request Repository#addPullRequest
name
stringrepository
Repositoryprovider
Providertitle
string?state
string?Returns Provider
Delete the pull request from the Repository.
Returns Promise
Merge the pull request
Decline the pull request
Extends Owner
Abstract repository as a collection
Representation of one file or directory entry
path
string file name inside of the repositorycontent
(string | Buffer | Stream) (optional, default undefined
)type
string type of the content (optional, default 'blob'
)mode
string file permissions (optional, default '100644'
)path
string file name inside of the repositorycontent
(string | Buffer | Stream)type
string type of the contentmode
string file permissionsWith npm do:
npm install repository-provider
BSD-2-Clause
FAQs
abstract interface to git repository providers like github, bitbucket and gitlab
We found that repository-provider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.