# sftp-j

> 上传或者下载服务器文件

Latest version **1.0.6** (published 2021-11-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install sftp-j
pnpm add sftp-j
yarn add sftp-j
bun add sftp-j
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2021-11-07 |
| First published | 2021-11-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | benjazhu |
| Maintainers | benjazhu |
| Keywords | sftp, ftp |

## Links

- npm: https://www.npmjs.com/package/sftp-j
- npm.io page: https://npm.io/package/sftp-j

## Dependencies (1)

- [ssh2-sftp-client](https://npm.io/package/ssh2-sftp-client.md) ^7.1.0

## Recent versions

- 1.0.6 (latest) — 2021-11-07
- 1.0.5 — 2021-11-07
- 1.0.4 — 2021-11-07
- 1.0.3 — 2021-11-07
- 1.0.2 — 2021-11-07
- 1.0.1 — 2021-11-07
- 1.0.0 — 2021-11-07

## README

## Installation

```
$ npm i sftp-j
```

## Basic Usage

```javascript
const SftpTool = require("sftp-j");
const sftp = new SftpTool({
  host: "your server ip address",
  port: "",
  username: "root",
  password: "******",
});

//download file
(async () => {
  //local file    remote file
  let res = await sftp.downloadFile("./1.txt", "/root/test/1.txt");
  console.log(res);
})();

//uploadFile file
(async () => {
  let res = await sftp.uploadFile("./1.txt", "/root/test/1.txt");
  console.log(res);
})();
```

---
_Source: https://npm.io/package/sftp-j · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
