Upload files to or download from an FTP-server
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
fixture
tasks
.editorconfig
.gitattributes
.gitignore
.travis.yml
gruntfile.js
license
package.json
readme.md
test.js

readme.md

grunt-ftp Build Status

Upload files to or download from an FTP-server

Useful for uploading, deploying and downloading things.

Install

$ npm install --save-dev grunt-ftp

Usage

Upload

require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks

grunt.initConfig({
	ftpPut: {
		options: {
			host: 'website.com',
			user: 'johndoe',
			pass: '1234'
		},
		upload: {
			files: {
				'public_html': 'src/*'
			}
		}
	}
});

grunt.registerTask('default', ['ftpPut']);

Download

require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks

grunt.initConfig({
	ftpGet: {
		options: {
			host: 'website.com',
			user: 'johndoe',
			pass: '1234'
		},
		download: {
			files: {
				'public_html/file.txt': 'src/file.txt'
			}
		}
	}
});

grunt.registerTask('default', ['ftpGet']);

Options

host

Required
Type: string

port

Type: number
Default: 21

user

Type: string
Default: 'anonymous'

pass

Type: string
Default: '@anonymous'

License

MIT © Sindre Sorhus