# git-listener

> Auto deploy from git

Latest version **1.1.0** (published 2016-09-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install git-listener
pnpm add git-listener
yarn add git-listener
bun add git-listener
```

## 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.0 |
| Published | 2016-09-02 |
| First published | 2016-08-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | NearlyDeadHipo |
| Maintainers | nearlydeadhipo |
| Keywords | git, github, bitbucket, deploy, auto-deploy, pull, clone, fetch, auto |

## Links

- npm: https://www.npmjs.com/package/git-listener
- Repository: https://github.com/DeadHipo/git-listener
- Homepage: https://github.com/DeadHipo/git-listener#readme
- Issues: https://github.com/DeadHipo/git-listener/issues
- npm.io page: https://npm.io/package/git-listener

## Dependencies (1)

- [express](https://npm.io/package/express.md) ^4.14.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-09-02
- 1.0.5 — 2016-08-31
- 1.0.4 — 2016-08-31
- 1.0.3 — 2016-08-31
- 1.0.2 — 2016-08-31
- 1.0.1 — 2016-08-31
- 1.0.0 — 2016-08-31

## README

###Get started
##Install
Install the module with:
`
npm install git-listener
`

##Use

```js
//index.js

var Git = require('git-listener');

var git = new Git({
	port: PORT_NUMBER, //Port for webhook
	branch: 'master', //Branch for clone
	name: 'name-of', //Project and path name 
	clonePath: '/path/to', //Path where the project will be cloned. Full path let looks like /path/to/name-of
	repo: 'git@name.com:user/name-of.git' //SSH clone
});

//Data from stderr and stdout
git.on('done', function(msg) {
	console.log(msg);
})
.on('error', function(error) {
	console.log(error);
});
```

###Hook
Make sure that you have added webhook in your git setup **http:hostname.ru:port** and run **index.js**.
For example using **forever**.
`forever start index.js`

##P.S
If the specified path is not a have project directory, it will clone otherwise it will be renewed.
To restart the project useful **nodemon** or other similar modules.

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