All Projects → naqvis → brotli.cr

naqvis / brotli.cr

Licence: MIT license
Crystal bindings to the Google brotli compression library

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to brotli.cr

Brotli-IIS
Brotli Compression Scheme Plugin for Microsoft IIS 7+
Stars: ✭ 47 (+135%)
Mutual labels:  brotli, brotli-encoder, brotli-compression
triki
Mysql, PostgreSQL and SQL dump obfuscator aka anonimizer
Stars: ✭ 28 (+40%)
Mutual labels:  crystal-language, crystal-lang
praetorian
A minimalist Crystal authorization system inspired by https://github.com/varvet/pundit.
Stars: ✭ 54 (+170%)
Mutual labels:  crystal-language, crystal-lang
cr-xmpp
XMPP/Jabber Library for Crystal
Stars: ✭ 16 (-20%)
Mutual labels:  crystal-language, crystal-lang
Reactql
Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
Stars: ✭ 1,833 (+9065%)
Mutual labels:  brotli
Setup Nginx Webserver
🚀Setup a perfect webserver on CentOS/Redhat 7.x guide with understanding.
Stars: ✭ 65 (+225%)
Mutual labels:  brotli
Aspnetcore Request Decompression
HTTP request decompression middleware for ASP.NET Core
Stars: ✭ 51 (+155%)
Mutual labels:  brotli
Connect Gzip Static
connect middleware for statically compressed files
Stars: ✭ 39 (+95%)
Mutual labels:  brotli
cocol
Rapid blockchain prototyping
Stars: ✭ 19 (-5%)
Mutual labels:  crystal-language
P7zip
A new p7zip fork with additional codecs and improvements (forked from https://sourceforge.net/projects/p7zip/).
Stars: ✭ 222 (+1010%)
Mutual labels:  brotli
Fusebox Angular Universal Starter
Angular Universal seed project featuring Server-Side Rendering, @fuse-box bundling, material, firebase, Jest, Nightmare, and more
Stars: ✭ 132 (+560%)
Mutual labels:  brotli
Fastify Compress
Fastify compression utils
Stars: ✭ 95 (+375%)
Mutual labels:  brotli
Iltorb
Node.js module for brotli compression/decompression with native bindings
Stars: ✭ 161 (+705%)
Mutual labels:  brotli
Nuxt Compress
A simple static asset compression module for Nuxt that runs Gzip and Brotli compression during the build process
Stars: ✭ 61 (+205%)
Mutual labels:  brotli
Express Static Gzip
Simple wrapper on top of serveStatic, that allows serving pre-gzipped files as well as other types of compressions.
Stars: ✭ 119 (+495%)
Mutual labels:  brotli
Deno brotli
🗜 Brotli wasm module for deno
Stars: ✭ 40 (+100%)
Mutual labels:  brotli
Turbobench
Compression Benchmark
Stars: ✭ 211 (+955%)
Mutual labels:  brotli
7 Zip Zstd
7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard
Stars: ✭ 2,150 (+10650%)
Mutual labels:  brotli
Libbrotli
meta project to build libraries from the brotli source code
Stars: ✭ 110 (+450%)
Mutual labels:  brotli
Nginx Ee
Automated Nginx compilation from sources with additional modules support. Compatible with WordOps, EasyEngine & Plesk
Stars: ✭ 132 (+560%)
Mutual labels:  brotli

Crystal Brotli

CI GitHub release Docs

Crystal bindings to the Brotli compression library.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      brotli:
        github: naqvis/brotli.cr
  2. 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

  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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].