brotli
Version, currently 0.1.26 versions
github.com/naqvis/brotli.cr
Crystal bindings to the Brotli compression library.
28 stars
1 dependent
License: MIT
Nothing has been indexed for 0.1.2 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
brotli:
github: naqvis/brotli.cr
version: ~> 0.1.2Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.2. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# Crystal Brotli

[](https://github.com/naqvis/brotli.cr/releases)
[](https://naqvis.github.io/brotli.cr/)
Crystal bindings to the [Brotli](https://github.com/google/brotli) compression library.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
brotli:
github: naqvis/brotli.cr
```
2. Run `shards install`
## Usage
```crystal
require "brotli"
```
`brotli` shard provides both `Compress::Brotli::Reader` and `Compress::Brotli::Writer` , as well as `Compress::Brotli#decode` and `Compress::Brotli#encode` methods for quick usage.
Refer to `specs` for sample usage.
## Example: decompress an brotli file
#
```crystal
require "brotli"
string = File.open("file.br") do |file|
Compress::Brotli::Reader.open(file) do |brotli|
brotli.gets_to_end
end
end
pp string
```
## Example: compress to brotli compression format
#
```crystal
require "brotli"
File.write("file.txt", "abcd")
File.open("./file.txt", "r") do |input_file|
File.open("./file.br", "w") do |output_file|
Compress::Brotli::Writer.open(output_file) do |brotli|
IO.copy(input_file, brotli)
end
end
end
```
## Development
To run all tests:
```
crystal spec
```
## Contributing
1. Fork it (<https://github.com/naqvis/brotli.cr/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Ali Naqvi](https://github.com/naqvis) - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.2- Tagged
- Mar 24, 2021
- Commit
1c374c037cbe- Indexed
- not yet
Dependents
Repository
github.com/naqvis/brotli.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 6