# instadeploy

> Instantly Deploy a folder to multiple servers

Latest version **0.3.5** (published 2015-10-24) · MIT license · 0 weekly downloads

## Install

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

Provides the commands `deploy`, `instadeploy`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.5 |
| Published | 2015-10-24 |
| First published | 2015-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Schahriar SaffarShargh |
| Maintainers | schahriar |
| Keywords | deploy, sftp, ssh, instant, instadeploy |

## Links

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

## Dependencies (8)

- [herb](https://npm.io/package/herb.md) ^2.2.6
- [scp2](https://npm.io/package/scp2.md) ^0.2.2
- [async](https://npm.io/package/async.md) ^1.4.2
- [chokidar](https://npm.io/package/chokidar.md) ^1.2.0
- [inquirer](https://npm.io/package/inquirer.md) ^0.10.1
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.0
- [lodash.uniq](https://npm.io/package/lodash.uniq.md) ^3.2.2

## Recent versions

- 0.3.5 (latest) — 2015-10-24
- 0.3.4 — 2015-10-07
- 0.3.3 — 2015-10-06
- 0.3.2 — 2015-10-06
- 0.3.1 — 2015-10-05

## README

# InstaDeploy
#### InstaDeploy Watches a folder and deploys using SFTP to multiple servers when changes are made. It is great for use in source deployment where a large number of hosts are at play.

# Installation
```javascript
npm install -g instadeploy
```

# Usage
You can use either **instadeploy** or **deploy** cmd/terminal command.

----
Setup a new host
```Batchfile
instadeploy add <unique_name> <host_ip> <username> <password> <unique_remote_path> <privateKey>
```

----
Ignore development folders (Ignore follows [Minimatch's](https://github.com/isaacs/minimatch) Glob Expressions Format)
```Batchfile
instadeploy ignore ".gitignore" "node_modules/**" ".git/**" <pattern4> <pattern5> ...
```

----
Watch a folder (use *-v* or *-verbosity* to get accurate input)
```Batchfile
instadeploy watch <local_path> <common_remote_path>
```

----
Remove a host
```Batchfile
instadeploy remove <name>
```

----
Remove an ignore pattern
```Batchfil
instadeploy allow <pattern>
```

# API
Instance -> InstaDeploy(<Array:Objects>Hosts, <Object>Options)
Example:
```javascript
var fs = require('fs');
var InstaDeploy = require('instadeploy');
var Deployer = new InstaDeploy([
  { name: 'test', host: '127.0.0.1', port: 8085, username: 'root', password: 'test', path: 'uploads', privateKey: fs.readFileSync('/path/to/key') },
  { name: 'host2', host: '127.0.0.1', port: 8045, username: 'notroot', password: 'test2', path: 'test', privateKey: fs.readFileSync('/path/to/key2') }
], {
  ignore: ['node_modules\\**', '.gitignore']
})
```
*Note:* If a password is not provided the user will be prompted for it. To disable this pass a 'noprompt' attribute with every remote connection object that is passed to InstaDeploy.

## Options
- **maxConcurrentConnections**:   \<Number> 5
- **queueTime**:    \<Time:MS> 1500
- **ignore**:   \<Array> ['.git', 'node_modules']

## Events
- **attempt**: (args-> \<Object>Host, \<Int>NoOfRetries) Emitted when a new connection attempt is made
- **connect**: (args-> \<Object>Host, \<Int>NoOfRetries, \<Object>Handler) Emitted when a connection is made to one of the hosts
- **disconnect**: (args-> \<Object>Host, \<Int>NoOfRetries, \<Object>Handler) Emitted when a connection is lost
-   --------
- **uploadStarted**: (\<String>RelativePath, \<String>AbsolutePath, \<String>RemotePath) Emitted when a file has been queued for upload
- **uploaded**: (args-> \<String>RelativePath, \<String>AbsolutePath) Emitted when an upload has successfully completed
- **ignored**: (args-> \<String>RelativePath, \<String>AbsolutePath) Emitted when a file has been ignored
- **failed**: (args-> \<Error>Error, \<String>RelativePath, \<String>AbsolutePath) Emitted when an upload has failed
-   --------
- **start**: (args-> \<Int>NumberOfItems) Emitted when a new batch is queued for upload
- **end**: (args-> None) Emitted when all items of the batch have been uploaded

## License
MIT &copy; Schahriar SaffarShargh - [Full License](https://github.com/schahriar/anti/blob/master/README.md)

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