git-local-info-ts
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

git-local-info-ts

Fork of https://github.com/ycjcl868/git-local-info

Badges

npm package


gitInfo

Retrieves repo information without relying on the git command.

Usage

git-local-info

import GitInfo from 'git-local-info';


const gitInfo = new GitInfo();

const result = gitInfo.getGitInfo;

// result is:
{
  /** The current branch */
  branch: string;
  /** The current repository url */
  repository: string;
  /** SHA of the current commit */
  sha: string;
  /** The committer of the current SHA */
  commit: ICommit;
  /** The commit message for the current SHA */
  rootDir: string;
}

Params

new GitInfo(params);

// params
{
  // default process.cwd()
  gitPath: process.cwd(),
  // default .git
  GIT_DIR: '.git',
}

Screenshot

image

Readme

Keywords

Package Sidebar

Install

npm i git-local-info-ts

Weekly Downloads

1

Version

2.0.1

License

MIT

Unpacked Size

11.7 kB

Total Files

7

Last publish

Collaborators

  • yorch