{"size": 1045, "ext": "js", "max_stars_repo_path": "example/example.js", "max_stars_repo_name": "MadanBhandari/git-commit-push-via-github-api", "max_stars_repo_stars_event_min_datetime": "2017-10-22T08:55:13.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-19T21:53:46.000Z", "max_issues_repo_path": "example/example.js", "max_issues_repo_name": "evandrojr/git-commit-push-via-github-api", "max_issues_repo_issues_event_min_datetime": "2018-12-29T07:38:49.000Z", "max_issues_repo_issues_event_max_datetime": "2020-03-31T06:25:42.000Z", "max_forks_repo_path": "example/example.js", "max_forks_repo_name": "evandrojr/git-commit-push-via-github-api", "max_forks_repo_forks_event_min_datetime": "2018-10-17T10:51:25.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-07T00:32:34.000Z"}
{"max_stars_count": 66, "max_issues_count": 6, "max_forks_count": 20, "avg_line_length": 38.7037037037, "max_line_length": 99, "alphanum_fraction": 0.614354067}
const fs = require("fs");
const { gitCommitPush } = require("../lib/git-commit-push-via-github-api");
process.on("unhandledRejection", console.dir);
if (!process.env.GITHUB_API_TOKEN) {
    throw new Error("GITHUB_API_TOKEN=xxx node example.js");
}
gitCommitPush({
    owner: "azu",
    repo: "commit-to-github-test",
    files: [
        { path: "README.md", content: fs.readFileSync(__dirname + "/README.md", "utf-8") },
        { path: "dir/input.txt", content: fs.readFileSync(__dirname + "/dir/input.txt", "utf-8") },
        // Pass binary as Buffer
        { path: "next-item.mp3", content: fs.readFileSync(__dirname + "/next-item.mp3") },
        { path: "image.png", content: fs.readFileSync(__dirname + "/image.png") }
    ],
    fullyQualifiedRef: "heads/master",
    forceUpdate: false, //optional default = false
    commitMessage: "HELLO" //option default = "AutoCommit - " + new Date().getTime().toString();
})
    .then(res => {
        console.log("success", res);
    })
    .catch(err => {
        console.error(err);
    });
