README.md

# FTPasta

[![Package Version](https://img.shields.io/hexpm/v/ftpasta)](https://hex.pm/packages/ftpasta)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/ftpasta/)

A simple wrapper around Erlang's built-in `ftp` module.
This library is a work-in-progress, and should not be relied on in its current state.

## Example Usage

```sh
gleam add ftpasta
```
```gleam
import ftpasta
import ftpasta/tls_config
import gleam/io
import gleam/list

pub fn main() {
  // Connect to a server.
  let assert Ok(connection) =
    ftpasta.new("ftp.gnu.org")
    |> ftpasta.encryption(tls_config.Plaintext)
    |> ftpasta.connect()

  // List the files.
  let assert Ok(items) = ftpasta.list(connection, "")
  list.map(items, fn(item) { io.println(item.name) })

  // Close the connection.
  ftpasta.close(connection)
}
```

## Development

The included script `run_tests.sh` will start two instances of `vsftpd` with the required configuration, run all tests, and then shut the servers down.
```sh
./run_tests.sh
```