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

gitparse79

v0.2.1

Published

gitコマンドの出力を解析して構造化します。

Downloads

10

Readme

gitparse79

gitコマンドの出力を解析して構造化します。

使い方 - Usage

Node.js

var GitParse79 = require('gitparse79'),
    gitParse79 = new GitParse79(function(cmdAry, callback){
        var stdout = '';
        var _pathCurrentDir = process.cwd();
        process.chdir( '/path/to/git_repository/' ); // git実行時のカレントディレクトリはここで指定

        var proc = require('child_process').spawn('git', cmdAry);
        proc.stdout.on('data', function(data){
            stdout += data;
        });
        proc.stderr.on('data', function(data){
            stdout += data; // エラー出力も stdout に混ぜて送る
        });
        proc.on('close', function(code){
            callback(code, stdout);
        });

        process.chdir( _pathCurrentDir ); // カレントディレクトリを戻す
        return;
    });
    gitParse79.git(['status'], function(result){
        console.log(result);
    });

Browser

<script src="/path/to/gitparse79/dist/gitParse79.min.js"></script>
<script>
var gitParse79 = new GitParse79(function(cmdAry, callback){
    // サーバーでgitコマンドを実行するAPIを用意してください。
    // callback には、 gitコマンドが出力した文字列を返してください。
    var stdout = '';
    $.ajax({
        url: '/path/to/endpoint',
        data: cmdAry,
        success: function(data){
            stdout += data;
        },
        error: function(data){
            stdout += data; // エラー出力も stdout に混ぜて送る
        },
        complete: function(){
            callback(0, stdout);
        }
    });
    return;
});
gitParse79.git(['status'], function(result){
    console.log(result);
});
</script>

更新履歴 - Change log

gitparse79 v0.2.1 (2023年7月14日)

  • git push の解析を改善した。

gitparse79 v0.2.0 (2023年4月22日)

  • git status の解析結果に remoteBranchName を追加した。
  • 標準出力がコメントアウトされている場合にも解析できるようにした。
  • git log で、対象が抽出されない場合に起きるエラーを修正した。
  • git show の戻り値に timestamp を追加した。

gitparse79 v0.1.3 (2022年6月5日)

  • git remote の解析を追加。
  • git push の解析を追加。
  • git pull の解析を追加。
  • git diff の解析を追加。
  • git status が正しく解析できない場合がある不具合を修正。
  • git branch-a および -r オプションに対応した。
  • git log および git show--name-status オプションに対応した。

gitparse79 v0.1.2 (2019年8月10日)

  • ブラウザ版の呼び出し名の誤りを修正。

gitparse79 v0.1.1 (2019年8月9日)

  • git log の解析を追加。
  • git show の解析を追加。
  • git config の解析を追加。

gitparse79 v0.1.0 (2019年7月30日)

  • Initial Release.

ライセンス - License

MIT License

作者 - Author