# @slater/sync

> shopify theme deployment utility

Latest version **1.8.0** (published 2020-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @slater/sync
pnpm add @slater/sync
yarn add @slater/sync
bun add @slater/sync
```

Provides the command `slater-sync`.

## 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.8.0 |
| Published | 2020-04-14 |
| First published | 2019-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 389.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | https://thecouch.nyc |
| Maintainers | estrattonbailey, iamkevingreen |
| Keywords | shopify, themekit, upload |

## Links

- npm: https://www.npmjs.com/package/@slater/sync
- Homepage: https://github.com/the-couch/slater#readme
- npm.io page: https://npm.io/package/@slater/sync

## Dependencies (12)

- [w2t](https://npm.io/package/w2t.md) 0.0.2
- [exit](https://npm.io/package/exit.md) ^0.1.2
- [yaml](https://npm.io/package/yaml.md) ^1.2.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.1
- [log-update](https://npm.io/package/log-update.md) ^2.3.0
- [micromatch](https://npm.io/package/micromatch.md) ^3.1.10
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.2.0
- [zip-folder](https://npm.io/package/zip-folder.md) ^1.0.0
- [ansi-colors](https://npm.io/package/ansi-colors.md) ^3.0.4
- [@slater/util](https://npm.io/package/@slater/util.md) ^1.7.2
- [parse-gitignore](https://npm.io/package/parse-gitignore.md) ^1.0.1
- [recursive-readdir](https://npm.io/package/recursive-readdir.md) ^2.2.2

## Recent versions

- 1.8.0 (latest) — 2020-04-14
- 1.7.2 — 2020-04-14
- 2.1.2 — 2020-02-02
- 2.1.0 — 2020-01-27
- 2.0.3 — 2020-01-25
- 2.0.2 — 2020-01-22
- 2.0.1 — 2020-01-22
- 2.0.0 — 2020-01-21
- 1.6.0 — 2019-09-01
- 1.5.3 — 2019-08-16
- 1.5.2 — 2019-06-06
- 1.5.1 — 2019-06-06
- 1.5.0 — 2019-06-03
- 1.4.1 — 2019-05-23
- 1.4.0 — 2019-05-17
- … 31 more at https://npm.io/package/@slater/sync/versions

## README

# @slater/sync
Sync files between your local machine and a remote Shopify theme.

## Install
```bash
npm i @slater/sync -g
```

## Getting Started
Create a `slater.config.js` file, and define one or more themes:

```javascript
module.exports = {
  themes: {
    development: {
      id: '12345...',
      password: 'abcde...',
      store: 'store-name.myshopify.com',
      ignore: []
    },
    production: { ... }
  }
}
```

Then, use the CLI to `sync` or `unsync` files or directories:
```bash
slater-sync sync snippets/header.liquid # file
slater-sync sync snippets/ # directory
slater-sync unsync snippets/header.liquid
```

## Commands

#### `sync`
Sync a file or directory.
```bash
slater-sync sync snippets/header.liquid # file
slater-sync sync snippets/ # directory
```

#### `unsync`
Un-sync a file or directory.
```bash
slater-sync unsync snippets/header.liquid # file
slater-sync unsync snippets/ # directory
```

## API
`@slater/sync` can also be used in node, as it is in
[@slater/cli](https://github.com/the-couch/slater/tree/master/packages/cli).

```javascript
const sync = require('@slater/sync')

const theme = sync({
  id: '12345...',
  password: 'abcde...',
  store: 'store-name.myshopify.com',
  ignore: []
})
```

### Methods

#### `sync`
```javascript
// single file
theme.sync('./build/snippets/nav.liquid')

// multiple files
theme.sync([
  './build/snippets/nav.liquid',
  './build/templates/index.liquid'
])

// or a directory
theme.sync([
  './build/snippets/'
])
```

#### `unsync`
```javascript
theme.unsync([ 'templates/index.liquid' ])
```

## License
MIT License © [The Couch](https://thecouch.nyc)

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