git-cat-file
v0.5.1
Published
A pure-JavaScript implementation of `git cat-file -p` for Node.js.
Maintainers
Readme
git-cat-file
A pure-JavaScript implementation of git cat-file -p for Node.js.
SYNOPSIS
import {openLocalRepo} from "git-cat-file";
const repo = openLocalRepo("repository/.git");
const commit = await repo.getCommit("HEAD");
const file = await commit.getFile("path/to/file.txt");
process.stdout.write(file.data);See types/git-cat-file.d.ts for the full type definitions and per-method documentation.
CLI
Usage:
git-cat-file-js [-C path] [-t | -p] <object>
git-ls-tree-js [-C path] [<options>] <tree-ish> [<path>...]
git-rev-parse-js [-C path] <args>...The CLI commands shipped with the package are also available as git subcommands when node_modules/.bin is on $PATH:
npm install git-cat-file
export PATH="node_modules/.bin:$PATH"
git cat-file-js [-t | -p] <object>
git ls-tree-js [<options>] <tree-ish> [<path>...]
git rev-parse-js <args>...LINKS
- https://github.com/kawanet/git-cat-file
- https://www.npmjs.com/package/git-cat-file
- https://www.npmjs.com/package/serve-static-git
