🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

load-repo

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

load-repo

Victor Bo's Download Git Repository.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

load-repo npm

You need to make sure git is in your path, otherwise you can move on
This is a library based on git-clone development

Install

load-repo

npm install load-repo

Api

loadRepo(repo: string): void


loadRepo(repo: string, path?: string): void


loadRepo(repo: string, path?: string, options?: IOptions): void


loadRepo(repo: string, path?: string, callback?: (error?: Error) => void): void


loadRepo(repo: string, path?: string, options?: IOptions, callback?: (error?: Error) => void): void


repo
// rule: origin:owner/name#branch

const repo = 'github:vtrbo/load-repo#main'

path
// default value process.cwd()

const path = '/'

options
/**
 * IOptions
 * {
 *   if clone is true, keep .git; otherwise, delete it
 *   clone: boolean
 *
 *   if branch is undefined, Clone the default branch
 *   branch: string
 * }
 */

const options = {
  clone: true,
  branch: 'main'
}

callback
// if error exists, it means that the download failed; otherwise, it succeeded

const callback = (error: Error) => {
  if (error)
    console.log('download fail')
  else
    console.log('download success')
}

开源许可证

MIT License © 2022-PRESENT Victor Bo

Keywords

vtrbo

FAQs

Package last updated on 05 Aug 2022

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