Popularity
5.2
Stable
Activity
0.0
Stable
25
4
0
Programming language: Crystal
License: MIT License
Tags:
Compression
Latest version: v0.1.3
brotli.cr alternatives and similar shards
Based on the "Compression" category.
Alternatively, view brotli.cr alternatives based on common mentions on social networks and blogs.
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
Promo
www.influxdata.com

Do you think we are missing an alternative of brotli.cr or a related project?
Popular Comparisons
README
Crystal Brotli
Crystal bindings to the Brotli compression library.
Installation
- Add the dependency to your
shard.yml
:
dependencies:
brotli:
github: naqvis/brotli.cr
- Run
shards install
Usage
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
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
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
- Fork it (https://github.com/naqvis/brotli.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Ali Naqvi - creator and maintainer