@nodegit/is

1.0.0 • Public • Published

Build Status Coverage

@nodegit/is

The definitive checking library for git

Install

$ npm i @nodegit/is

Usage

const is = require('@nodegit/is')

// Test if the current working directory is a git repo
// or inside a git repo
is.git()

// Which is equivalent to
is.git(process.cwd())

// Test if the current working directory is the root of a git repo
is.gitRoot()

git(dir = process.cwd()): boolean

  • dir string=process.cwd() the directory to be tested. If not specified, the current working directory will be used

Returns boolean true if cwd is the root of a git repo or inside a git repo

gitRoot(dir = process.cwd()): boolean

  • dir

Returns boolean true if cwd is the root of a git repo

License

MIT

Package Sidebar

Install

npm i @nodegit/is

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.78 kB

Total Files

5

Last publish

Collaborators

  • kael