Skip to content

kawanet/git-cat-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-cat-file

Node.js CI npm version

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

About

Pure JavaScript `git cat-file -p` for node.js

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors