# gift-wrapper

> A Q wrapper for the gift library to perform git operations in node.

Latest version **1.1.1** (published 2016-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install gift-wrapper
pnpm add gift-wrapper
yarn add gift-wrapper
bun add gift-wrapper
```

## 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 | 1.1.1 |
| Published | 2016-01-15 |
| First published | 2015-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zp Bappi |
| Maintainers | zpbappi |
| Keywords | q, gift, git, node, wrapper |

## Links

- npm: https://www.npmjs.com/package/gift-wrapper
- Repository: https://github.com/zpbappi/gift-wrapper
- Issues: https://github.com/zpbappi/gift-wrapper/issues
- npm.io page: https://npm.io/package/gift-wrapper

## Dependencies (2)

- [q](https://npm.io/package/q.md) ^1.4.1
- [gift](https://npm.io/package/gift.md) ^0.6.1

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2016-01-15
- 1.1.0 — 2015-10-26
- 1.0.2 — 2015-10-17
- 1.0.1 — 2015-10-17
- 1.0.0 — 2015-10-16

## README

# gift-wrapper
A [Q](https://github.com/kriskowal/q) wrapper for the [gift](https://github.com/notatestuser/gift) library to perform git operations in node.

## Installation
It does not get any easier.
```
npm install gift-wrapper
```

## API documentation
`gift-wrapper` API is (almost) exactly same as `gift`. Only differece is, instead of doing the folowing in `gift`
```js
someObject.some_method( [arguments], callback );
```

we will be able to do the following in `gift-wrapper`
```js
someObject.some_method( [arguments] )
.then( some_callback )
.fail( error_handler )
```

Here is the link to [gift README file](https://github.com/notatestuser/gift/blob/master/README.md) for API reference.

### Special note about callbacks
There are two forms of callbacks in `gift`. They are-

1. `callback (error, result)`
2. `callback (result)`

However, callback function of form `callback(error, result)` is not present
in `gift-wrapper`. Instead, the `error` parameter will be available in error handlers
of `Q` promises (i.e. in `fail()` method) in appropriate situations. All other callback
functions from `gift` remains same and results are avaialble in immediate `then()` after the call.

### Synchronous execution
Although very rare, but there are few function in `gift` which executes in a synchronous manner
and returns the result of execution directly, rather than via a callback function.
This behavior remains the same in `gift-wrapper` to be consistent with `gift`.

### Example
```js
var gw = require("gift-wrapper");

var repo = gw("/path/to/local/repo");

repo.identity()
.then(function(id){
  console.log(id); // asynchronously getting author information from the repository
  return repo.status();
})
.then(function(status){
  console.log(status); // asynchronously getting status of the repository
})
.fail(console.error); // sending errors to print in stderr, if there is any error

var tree = repo.tree();
console.log(tree); // synchronously getting the tree from the repository
```

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