# gitexec

> A specialised child process spawn for `git` commands

Latest version **2.0.1** (published 2019-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install gitexec
pnpm add gitexec
yarn add gitexec
bun add gitexec
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-10-14 |
| First published | 2015-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Rod |
| Maintainers | rvagg |

## Links

- npm: https://www.npmjs.com/package/gitexec
- Repository: https://github.com/rvagg/gitexec
- Homepage: https://github.com/rvagg/gitexec#readme
- Issues: https://github.com/rvagg/gitexec/issues
- npm.io page: https://npm.io/package/gitexec

## Dependencies (1)

- [bl](https://npm.io/package/bl.md) ^4.0.0

## Recent versions

- 2.0.1 (latest) — 2019-10-14
- 2.0.0 — 2019-10-02
- 1.0.0 — 2015-12-14

## README

# gitexec [![Build Status](https://github.com/rvagg/gitexec/workflows/Tests/badge.svg)](https://github.com/rvagg/gitexec/actions)

**A specialised child process spawn for `git` commands**

_Compatible with Node.js 8.x_

Note: while there's nothing currently preventing this from being used to execute arbitrary bash commands, be warned that it's use is focused on git and the API may evolve to be more specific into the future. You're welcome to fork or copy the patterns used if you need similar functionality for other uses.

## API

### `gitexec.exec(repoPath, gitCommand)`

Execute `gitCommand` in a newly spawned Bash shell.

Returns a `Stream` with stdout. Any non-zero exit code will cause an `'error'` event on the stream.

Stderr is printed to directly stderr.

### `gitexec.execCollect(repoPath, gitCommand, callback)`

A form of `exec()` that collects stdout and returns it as a single `String` on the `callback`. Any errors encountered will be given as the first argument to the `callback`.

## License

**gitexec** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.

---
_Source: https://npm.io/package/gitexec · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
