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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ming-github

v1.0.4

Published

github客户端

Readme

ming-github

github客户端

参考文档地址 https://segmentfault.com/a/1190000015144126?utm_source=tag-newest

#1. 普通页面使用ming-github

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="https://minglie.github.io/js//M_github.js"></script>
<body>

<button id="btn">执行</button>
<script>
    github=new Github({token:"2ff060ad1f68fd0a16beb73e608c3853da472737",username: 'minglie'});
    btn.onclick=async function () {
     //  github.reposListAll().then(d=>console.log(d))
      //  github.fileContents("ming_node","/index.js").then(d=>console.log(d))
       // github.createContent("ming_node","/wang/a14.js","网朋飞").then(d=>console.log(d),e=>console.log(e))
        github.updateContent("ming_node","/wang/a14.js","QQQQQQQQ").then(d=>console.log(d.commit.sha),e=>console.log(e))

    }


</script>

</body>
</html>

#2. node环境使用ming_github


const Github = require('ming-github');

github=new Github({token:"2ff060ad1f68fd0a16beb73e608c3853da472737",username: 'minglie'});


/**
 * 个人主要信息
 */
if(1)
github.getUser().then(d=>console.log(d.data))


/**
 * 个人所有仓库
 */
if(0)
github.reposListAll().then(d=>console.log(d.data))


/**
 * 仓库详情
 */
if(0)
github.reposDetails("ming_node").then(d=>console.log(d.data))


/**
 * 获取某个repo的内容列表,或文件信息
 */
if(0)
github.reposContents("ming_node","/a3.js").then(d=>console.log(d.data))


/**
 * 获取某文件的原始内容
 */
if(0)
github.fileContents("ming_node","/index.js").then(d=>console.log(d.data))



/**
 * repo中所有的commits列表
 * sha="/c15c91a059f7ea83964fda621f8edf990727616e"
 */
if(0)
github.commitList("ming_node","/a527d9b8b9d7085dbf87b90f6f247c4fe54fe4fe").then(d=>console.log(d.data))



/**
 * issues列表
 * issueNum="/1"
 */
if(0)
github.issuesList("ming_node").then(d=>console.log(d.data))



if(0)
github.test("ming_node").then(d=>console.log(d.data),e=>console.log(e))


/**
 * 创建新文件 Create content
 */
if(0)
github.createContent("ming_node","/wang/a3.js","网朋sdfsdf飞").then(d=>console.log(d.data.commit.sha),e=>console.log(e))




/**
 * 更新文件 Update content
 */
if(0)
github.updateContent("ming_node","/wang/a3.js","段舍得坊").then(d=>console.log(d.data.commit.sha),e=>console.log(e))


/**
 * 删除文件 Delete content
 */
if(0)
github.deleteContent("ming_node","/wang").then(d=>console.log(d.data),e=>console.log(e))



/**
 * 增加一条issue
 */
if(0)
github.createIssue("ming_node",{
    "title": "Creating issue from API",
    "body": "Posting a issue from Insomnia"
}).then(d=>console.log(d.data),e=>console.log(e))


/**
 * 更改某条issue
 */
if(0)
github.updateIssue("ming_node",1,{
    "title": "AAAA",
    "body": "Addf a issue from Insomnia",
    "state": "open"
}).then(d=>console.log(d.data),e=>console.log(e))



/**
 * 锁住某条issue
 */
if(0)
github.lockIssue("ming_node",1).then(d=>console.log(d.data),e=>console.log(e))



/**
 * 解锁某条issue
 */
if(0)
github.unlockIssue("ming_node",1).then(d=>console.log(d.data),e=>console.log(e))


/**
 * 增加comment
 */
if(0)
github.createComment("ming_node",1, "BBB").then(d=>console.log(d.data),e=>console.log(e))

/**
 * 更改comment
 */
if(0)
github.updateComment("ming_node", "493643757","VWBBB").then(d=>console.log(d.data),e=>console.log(e))


/**
 * 删除comment
 */
if(0)
github.deleteComment("ming_node", "493643757").then(d=>console.log(d.data),e=>console.log(e))