0.0.9 • Published 5 years ago
@slaty/sync v0.0.9
@slaty/sync
Sync files between your local machine and a remote Store theme.
Install
npm i @slaty/sync -gGetting Started
Create a slaty.config.js file, and define one or more themes:
module.exports = {
themes: {
development: {
id: '12345...',
password: 'abcde...',
store: 'store-name.mystore.com',
ignore: []
},
production: { ... }
}
}Then, use the CLI to sync or unsync files or directories:
slaty-sync sync snippets/header.liquid # file
slaty-sync sync snippets/ # directory
slaty-sync unsync snippets/header.liquidCommands
sync
Sync a file or directory.
slaty-sync sync snippets/header.liquid # file
slaty-sync sync snippets/ # directoryunsync
Un-sync a file or directory.
slaty-sync unsync snippets/header.liquid # file
slaty-sync unsync snippets/ # directoryAPI
@slaty/sync can also be used in node, as it is in
@slaty/cli.
const sync = require('@slaty/sync')
const theme = sync({
id: '12345...',
password: 'abcde...',
store: 'store-name.mystore.com',
ignore: []
})Methods
sync
// 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
theme.unsync([ 'templates/index.liquid' ])License
MIT License ©