# ftp-response-parser

> Parser for FTP server responses

Latest version **1.0.1** (published 2014-09-30) · 0 weekly downloads

## Install

```sh
npm install ftp-response-parser
pnpm add ftp-response-parser
yarn add ftp-response-parser
bun add ftp-response-parser
```

## 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.1 |
| Published | 2014-09-30 |
| First published | 2013-11-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Sergi Mansilla |
| Maintainers | sergi |
| Keywords | ftp, response, protocol, files, server, client, async |

## Links

- npm: https://www.npmjs.com/package/ftp-response-parser
- Repository: https://github.com/sergi/ftp-response-parser
- Issues: https://github.com/sergi/ftp-response-parser/issues
- npm.io page: https://npm.io/package/ftp-response-parser

## Dependencies (1)

- [readable-stream](https://npm.io/package/readable-stream.md) ^1.0.31

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2014-09-30
- 1.0.0 — 2013-11-18

## README

# ftp-response-parser

This module provides a fast, lightweight streaming parser for FTP response
format strings.

Given a string like this:

```
211-Features supported:\n
 EPRT\n
 EPSV\n
 MDTM\n
 MLST type*;perm*;size*;modify*;unique*;unix.mode;unix.uid;unix.gid;\n
 REST STREAM\n
 SIZE\n
 TVFS\n
 UTF8\n
211 End FEAT.\n
215 UNIX Type: L8\n
331 Username ok, send password.\n
230 Login successful.\n
200 Type set to: Binary.\n
250 "/test" is the current directory.\n
```

it will stream the following objects:

```javascript
{
  code: 211,
  text: '211-Features supported:\n EPRT\n EPSV\n MDTM\n MLST type*;perm*;size*;modify*;unique*;unix.mode;unix.uid;unix.gid;\n REST STREAM\n SIZE\n TVFS\n UTF8\n211 End FEAT.',
  isMark: false,
  isError: false
}
{
  code: 215,
  text: '215 UNIX Type: L8',
  isMark: false,
  isError: false
}
{
  code: 331,
  text: '331 Username ok, send password.',
  isMark: false,
  isError: false
}
{
  code: 230,
  text: '230 Login successful.',
  isMark: false,
  isError: false
}
{
  code: 200,
  text: '200 Type set to: Binary.',
  isMark: false,
  isError: false
}
{
  code: 250,
  text: '250 "/test" is the current directory.',
  isMark: false,
  isError: false
}
```

## Usage

```javascript

var ResponseParser = require('ftp-response-parser');

var myParser = new ResponseParser();

myParser.on('readable', function() {
  var line;
  while (line = myParser.read()) {
    console.log(line.code); // will emit 215
  }
});

myParser.write('215 UNIX Type: L8');

```

## Install

To get the module, with [npm](https://npmjs.org) do:

```
npm install ftp-response-parser
```

## Test

With [npm](https://npmjs.org) do:

```
npm test
```

## License

MIT

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