UNPKG

1.91 kBMarkdownView Raw
1# Dugite - JS bindings for Git
2
3[![Greenkeeper badge](https://badges.greenkeeper.io/desktop/dugite.svg)](https://greenkeeper.io/)
4
5This project provides bindings for Node applications to interact with Git repositories, using the same command line interface that core Git offers.
6
7The source is in TypeScript, but can be consumed by any JavaScript application.
8
9### Getting Started
10
11Add it to your project:
12
13```
14> npm install dugite
15```
16
17Then reference it in your application:
18
19```js
20import { GitProcess, GitError, IGitResult } from 'dugite'
21
22const pathToRepository = 'C:/path/to/git/repository/'
23
24const result = await GitProcess.exec([ 'status' ], pathToRepository)
25if (result.exitCode === 0) {
26 const output = result.stdout
27 // do some things with the output
28} else {
29 const error = result.stderr
30 // error handling
31}
32```
33
34### Features
35
36 - make it easy to work with Git repositories
37 - use the same commands as you would in a shell
38 - access to the full set of commands, options and formatting that Git core uses
39 - access to the latest features of Git
40
41### Supported Platforms
42
43 - Windows 7 and later
44 - macOS 10.9 and up
45 - Linux (tested on Ubuntu Precise/Trusty and Fedora 24)
46
47### Status
48
49This project is under active development for Git-related projects at GitHub. This will stabilize as this library gets more usage in production, and is open to external contributions that align with the project's goals.
50
51If you are interested in getting involved with this project, refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) file for instructions and the [documentation](./docs/) sections for more information about the project.
52
53### Roadmap
54
55As this is under active development, the roadmap is also subject to change. Some ideas:
56
57 - authentication support in-the-box
58 - make environment setup easier to override
59 - API additions for common tasks such as parsing output
60 - error handling improvements