Wrapper for using git commands in Node.js.
yarn add @himenon/git-control-js
import * as GitControl from "@himenon/git-control-js";
const main = async () => {
const git = GitControl.Wrap.create(process.cwd());
await git.clone({
owner: "Himenon",
repo: "git-control-js",
branch: "main",
baseUrl: "https://github.com",
baseSsh: "[email protected]",
protocol: "https",
outputDir: process.cwd(),
authToken: "", // https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#http-based-git-access-by-an-installation
});
const latestCommitDate = await git.getLatestCommitDate()
console.log(latestCommitDate);
}
main().catch(error => {
console.error(error);
process.exit(1);
})
scripts | description |
---|---|
build |
typescript build and create proxy directory |
clean |
clean up |
format:code |
prettier |
format:yarn:lock |
yarn.lock deduplicate |
lerna:version:up |
lerna version up |
test |
execute test:depcruise, test:jest |
test:depcruise |
dependency-cruiser's test |
test:jest |
jest test |
ts |
execute ts-node |
release:github:registry |
publish github registry |
release:npm:registry |
publish npm registry |
main
branch.