npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@boses/github-clone

v1.1.6

Published

解决国内 Github clone 速度慢的工具

Downloads

43

Readme

GitHub-clone

mlt mlt

为了解决国内 GitHub clone 速度慢较慢的工具

注意以下文档书写形式遵循下述规范:

[]代表这个字段必填,<>则为选填,而name?:string,表示这个参数为非必填为string类型。

执行流程

  • 首先将输入的 github.com替换成设置的镜像网站地址,默认为(github.com.cnpmjs.org)
  • 执行 git clone [url] 的操作
  • 拉取镜像完成之后,重写 git 的远程仓库推送地址,将镜像推送地址重置为 github 的镜像地址

CLI 使用方式

安装

yarn global add @boses/github-clone

之后通过g clone <path>形式来使用,更多APIclone的使用方法可以调用g ---help查看。

API

Clone

clone [dir] <--branch [branchName]>

  • <path>

    • type:stirng
    • require:true

    拉取 GitHub 仓库 对应的地址,可以拉取以下三种类型地址

    | 类型 | 说明 | | ------------------------------------------------ | ----------------------------- | | https://github.com/bosens-China/github-clone | 默认浏览器导航栏的地址 | | https://github.com/bosens-China/github-clone.git | Github 右侧 Code HTTPS 的地址 | | [email protected]:bosens-China/breeze-clone.git | Github 右侧 Code SSH 的地址 |

  • [dir]

    • type:stirng
    • require:false

    clone 到本地的目录名称

  • --branch [branchName]

    • type:stirng
    • require:false

    指定拉取的分支名称,可以以--branch长形式使用也可以以-b的短形式使用,例如:

    g clone https://github.com/bosens-China/github-clone.git -b dev

set [url]

  • [url]

    • type:stirng
    • require:true

    用于配置镜像网站

get

返回用户配置的set [url]地址,默认为github.com.cnpmjs.org

Node

安装

yarn add @boses/github-clone
const clone = require('@boses/github-clone');
// 也可以通过es模块引用
// import clone from '@boses/github-clone/gitClone.esm'
clone('https://github.com/SunshowerC/blog');

clone 会以同步的形式运行,记得使用 try 包裹住可能的错误

API

clone: (url: string, options: Partial<Options>) => void

url

  • type:string
  • require: true

拉取的 GitHub 仓库地址

options

| 名称 | 类型 | 是否必填 | 描述 | | ------------- | --------- | -------- | ------------------------------------------ | | dirName | string | false | 拉取的目录名称 | | branch | string | false | 拉取的分支名称 | | mirrorAddress | string | false | 镜像网站,如果你需要使用镜像可以填写此网站 | | silence | boolean | false | 是否静默模式执行 clone | | cwd | string | false | 执行 clone 所执行的目录路径 |

其他

目前版本更新导致对1.0.9之前的g get不支持,请重新执行g set [url]的操作

如果发现错误或者需要有更好的建议欢迎在 issues 中提出

参考

协议

MIT License