# divingbells
[](https://gitlab.com/erlang-dev/divingBells/-/pipelines)
[](https://codecov.io/gl/erlang-dev/divingBells)
[](https://gitlab.com/erlang-dev/divingBells/-/releases)
[](https://www.apache.org/licenses/LICENSE-2.0)
[](https://hexdocs.pm/divingBells/index.html)
`divingbells` is a escript for compressing and decompressing single file, files (WIP), and directories (WIP)
by using huffman coding or huffman coding-like algorithm.
## Installation
### Rebar3
`divingbells` is built using [rebar3](https://rebar3.readme.io/docs/getting-started),
if this library is used with rebar3 simply put it in your rebar.config file:
```
{deps, [
divingbells
]}.
```
### Other
If you don't use rebar3 it's possibly to get the latest version from [gitlab](https://gitlab.com/erlang-dev/divingBells/-/releases)
## Build
```
$ rebar3 compile
$ rebar3 escriptize
```
The escript is generated at `<project-root>/_build/default/bin/divingbells`.
Copy the executable `divingbells` and put it in your `PATH` in order to use it.
## Test
To run the tests call eunit via rebar3
```
$ rebar3 eunit
```
## Usage
### Configuration
The escript is primarly intended to be used through CLI.
The following configurations can be used
```
-C, --compress compress FILE
-D, --decompress decompress FILE
-f, --file FILE to compress or decomress
-d, --destination-file file to write the result to
-h, --help print this help
```
### Example
```
$ ls
divingbells example.txt
$ ./divingbells -C -f example.txt
$ ls
divingbells example.txt example.txt.dbc
$ ./divingbells -D -f example.txt.dbc -d example.text
$ ls
divingbells example.text example.txt example.txt.dbc
$ cat example.text
hello world
```