@corley/sftp-file-upload
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @corley/sftp-file-upload

Weekly Downloads

5

Version

0.0.4

License

MIT

Unpacked Size

2.43 kB

Total Files

4

Last publish

Collaborators

  • wdalmut