# @types/jsftp

> TypeScript definitions for jsftp

Latest version **2.1.5** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/jsftp
pnpm add @types/jsftp
yarn add @types/jsftp
bun add @types/jsftp
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.5 |
| Published | 2023-11-07 |
| First published | 2018-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51439 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/jsftp
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsftp
- npm.io page: https://npm.io/package/@types/jsftp

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 2.1.5 (latest) — 2023-11-07
- 2.1.2 (ts3.7) — 2021-10-26
- 2.1.1 (ts3.6) — 2021-07-08
- 2.1.0 (ts2.0) — 2018-09-08
- 2.1.4 — 2023-10-18
- 2.1.3 — 2023-09-15

## README

# Installation
> `npm install --save @types/jsftp`

# Summary
This package contains type definitions for jsftp (https://github.com/sergi/jsftp).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsftp.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsftp/index.d.ts)
````ts
/// <reference types="node" />

import { EventEmitter } from "events";
import { Socket } from "net";

export interface JsftpOpts {
    host?: string | undefined;
    port?: number | undefined;
    user?: string | undefined;
    pass?: string | undefined;
    createSocket?: (({ port, host }: { port: number; host: string }, firstAction: () => {}) => Socket) | undefined;
    useList?: boolean | undefined;
}

export type ErrorCallback = (err: Error) => void;
export type RawCallback = (err: Error, data: { code: number; text: string }) => void;
export type ListCallback = (err: Error, dirContents: string) => void;
export type GetCallback = (err: Error, socket: Socket) => void;
export type LsCallback = (err: Error, res: [{ name: string }]) => void;

export default class Ftp extends EventEmitter {
    constructor(opts: JsftpOpts);

    ls(filePath: string, callback: LsCallback): void;

    list(filePath: string, callback: ListCallback): void;

    get(remotePath: string, callback: GetCallback): void;
    get(remotePath: string, localPath: string, callback: ErrorCallback): void;

    put(source: string | Buffer | NodeJS.ReadableStream, remotePath: string, callback: ErrorCallback): void;

    rename(from: string, to: string, callback: ErrorCallback): void;

    // Ftp.raw(command, params, callback)
    raw(command: string, callback: RawCallback): void;
    raw(command: string, arg1: any, callback: RawCallback): void;
    raw(command: string, arg1: any, arg2: any, callback: RawCallback): void;
    raw(command: string, arg1: any, arg2: any, arg3: any, callback: RawCallback): void;
    raw(command: string, arg1: any, arg2: any, arg3: any, arg4: any, callback: RawCallback): void;
    auth(user: string, pass: string, callback: RawCallback): void;
    keepAlive(timeInMs?: number): void;

    destroy(): void;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Konrad Księski](https://github.com/xyleen).

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