Skip to content

Instantly share code, notes, and snippets.

@eyy
Created August 4, 2015 10:01
Show Gist options
  • Save eyy/4638671c8edd4fea533c to your computer and use it in GitHub Desktop.
Save eyy/4638671c8edd4fea533c to your computer and use it in GitHub Desktop.
Deploy static site to FTP
console.log('connecting ftp...')
var FTP = require('jsftp'),
async = require('async')
var ftp = new FTP({
host: '',
port: 21,
user: '',
pass: '',
debugMode: true
})
var from = './pub/',
to = '/'
var files = [
'index.html',
'css/index.css',
'js/index.js'
]
async.series(files.map(function (file) {
return function (cb) {
console.log('uploading', file)
ftp.put(from + file, to + file, cb)
}
}), function (err) {
if (err)
console.error(err)
console.log('ok')
ftp.raw.quit()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment