0.0.4 • Published 4 years ago

@corley/sftp-file-upload v0.0.4

Weekly downloads
4
License
MIT
Repository
-
Last release
4 years ago

Upload SSH2 SFTP

Using SSH2 https://github.com/mscdex/ssh2

Install it

npm i --save @corley/sftp-file-upload
npm i --save-dev @types/ssh2 @types/node

Example

import { upload } from '@corley/sftp-file-upload'

const options = {
    host: "1.1.1.1",
    username: "test",
    password: "test",
    port: 22,
}
upload(options, __dirname + '/data.txt', 'data.txt')
  .then(console.log)
  .catch(console.error)

In order to make it work you need to enter your credentials in the file named config.json. In this project you can see the example of how it should be in examples/config.json.dist. The other two parameters are: your local path and the remote path where the file is going to be uploaded.

Publish

Just use npm

npm run build

Then publish as npm package

npm publish --access public
0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago