1.3.11 • Published 2 years ago

@abysser/jit v1.3.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Jit

A lightweight nodejs-client of Git.

Quick Start

Install:

npm install @abysser/jit

Import:

const { jit } = require("@abysser/jit");

Usage

Create or index a Repo object:

const repo = jit.repo(/* absolute path of a local repository */);

Get basic infos of the repo:

console.log(repo.root);
console.log(repo.cwd);
console.log(repo.branch);
console.log(repo.head);

Run the git command:

repo.do("log", ["--oneline"]);

Pass parameters directly:

repo.do("log", ["--pretty=format:%an", "--", "src/index.ts"]);

Pass parameters by replacing \<xxx>:

repo.do("log", ["--pretty=format:<string>", "--", "<path>"], "%an", "src/index.ts");

do(command: NullCommand | GitCommand, args: GitArg[] | GitCommandArg[] = [], ...params: string[]): Pick\<GitReturns, "pid" | "stdout"> & { formatted?: ReturnType\<Formatter> }

Switch the current working directory:

repo.cd("src/routes");

cd(...paths: string[]): Repo

Called in a chain:

repo.cd("src").cd("../").do("add", ["--all"]);

License

MIT

Copyright 2022 Abyssers

1.3.11

2 years ago

1.3.10

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago