# md-sync

> Multiple destinations syncing(sync local files or directories to multiple destinations).

Latest version **0.2.0** (published 2018-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install md-sync
pnpm add md-sync
yarn add md-sync
bun add md-sync
```

Provides the command `md-sync`.

## 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.2.0 |
| Published | 2018-10-26 |
| First published | 2018-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 4 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | senntyou |
| Keywords | webpack, gulp, remote, server, sync, upload |

## Links

- npm: https://www.npmjs.com/package/md-sync
- Repository: https://github.com/senntyou/md-sync
- Issues: https://github.com/senntyou/md-sync/issues
- npm.io page: https://npm.io/package/md-sync

## Dependencies (4)

- [gulp](https://npm.io/package/gulp.md) ^4.0.0
- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [gulp-ssh](https://npm.io/package/gulp-ssh.md) ^0.7.0
- [commander](https://npm.io/package/commander.md) ^2.19.0

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2018-10-26
- 0.1.2 — 2018-07-31
- 0.1.1 — 2018-07-23
- 0.1.0 — 2018-06-14
- 0.0.1 — 2018-05-28

## README

# md-sync

Multiple destinations syncing(sync local files or directories to multiple destinations).

```
npm install md-sync --save-dev
```

**_package.json_**

```
"scripts": {
  "sync": "md-sync"
}
```

## config

Add a `md-sync.config.js` file to your project root.

```
module.exports = [
  // first destination
  {
    src: [globs, options],
    remotePath: 'remotePath',
    server: {
      ignoreErrors: true,
      sshConfig: {
        host: 'host',
        username: 'username',
        password: 'password'
      }
    },
  },
  // second destination
  ...
];
```

1.  `src`: [gulp src](https://github.com/gulpjs/gulp/blob/v4.0.0/docs/API.md#gulpsrcglobs-options) args
2.  `remotePath`: remote server path
3.  `server`: options for [gulp-ssh](https://github.com/teambition/gulp-ssh)

**_multiple server environments_**

If you need to support multiple server environments(`test`, `gray`, `prod`), you can do like this:

```
# package.json

"scripts": {
  "sync:test": "md-sync --env test",
  "sync:gray": "md-sync --env gray",
  "sync:prod": "md-sync --env prod"
}
```

With [minimist](https://github.com/substack/minimist).

```
# md-sync.config.js

const argv = require('minimist')(process.argv.slice(2));

const configs = {
  test: [
    { ... },
    ...
  ],
  gray: [
    { ... },
    ...
  ],
  prod: [
    { ... },
    ...
  ],
};

module.exports = configs[argv.env];
```

## do syncing

```
npm run sync
```

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