All Projects → nstepien → Iltorb

nstepien / Iltorb

Licence: other
Node.js module for brotli compression/decompression with native bindings

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Iltorb

Peazip
Free Zip / Unzip software and Rar file extractor. Cross-platform file and archive manager. Features volume spanning, compression, authenticated encryption. Supports 7Z, 7-Zip sfx, ACE, ARJ, Brotli, BZ2, CAB, CHM, CPIO, DEB, GZ, ISO, JAR, LHA/LZH, NSIS, OOo, PAQ/LPAQ, PEA, QUAD, RAR, RPM, split, TAR, Z, ZIP, ZIPX, Zstandard.
Stars: ✭ 827 (+413.66%)
Mutual labels:  brotli
Aspnetcore Request Decompression
HTTP request decompression middleware for ASP.NET Core
Stars: ✭ 51 (-68.32%)
Mutual labels:  brotli
7 Zip Zstd
7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard
Stars: ✭ 2,150 (+1235.4%)
Mutual labels:  brotli
Django Compression Middleware
Django middleware to compress responses using several algorithms.
Stars: ✭ 23 (-85.71%)
Mutual labels:  brotli
Connect Gzip Static
connect middleware for statically compressed files
Stars: ✭ 39 (-75.78%)
Mutual labels:  brotli
Setup Nginx Webserver
🚀Setup a perfect webserver on CentOS/Redhat 7.x guide with understanding.
Stars: ✭ 65 (-59.63%)
Mutual labels:  brotli
Rust Brotli
Brotli compressor and decompressor written in rust that optionally avoids the stdlib
Stars: ✭ 504 (+213.04%)
Mutual labels:  brotli
Nginx Ee
Automated Nginx compilation from sources with additional modules support. Compatible with WordOps, EasyEngine & Plesk
Stars: ✭ 132 (-18.01%)
Mutual labels:  brotli
Deno brotli
🗜 Brotli wasm module for deno
Stars: ✭ 40 (-75.16%)
Mutual labels:  brotli
Libbrotli
meta project to build libraries from the brotli source code
Stars: ✭ 110 (-31.68%)
Mutual labels:  brotli
Nano Nginx
Nano container with nginx preconfigured as reverse proxy
Stars: ✭ 15 (-90.68%)
Mutual labels:  brotli
Katwebx
An extremely fast static web server and reverse proxy for the modern web.
Stars: ✭ 39 (-75.78%)
Mutual labels:  brotli
Fastify Compress
Fastify compression utils
Stars: ✭ 95 (-40.99%)
Mutual labels:  brotli
Download Your Travelmap
free your travelmap
Stars: ✭ 22 (-86.34%)
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 (-26.09%)
Mutual labels:  brotli
Docker Nginx Http3
Alpine Linux image with Nginx 1.19.4 (mainline) with HTTP/3 (QUIC), TLSv1.3, 0-RTT, brotli, NJS support, and 10 MB size. All built on the bleeding edge for max performance. Built on the edge, for the edge.
Stars: ✭ 820 (+409.32%)
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 (-62.11%)
Mutual labels:  brotli
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 (+1038.51%)
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 (-18.01%)
Mutual labels:  brotli
Docker Nginx Brotli
Stable nginx with google brotli compression module
Stars: ✭ 107 (-33.54%)
Mutual labels:  brotli

iltorb

NPM Version Travis Build Status AppVeyor Build Status CircleCI Build Status

iltorb is a Node.js package offering native bindings for the brotli compression library.

Install

This module uses prebuild to download a pre-compiled binary for your platform, if it exists. Otherwise, it will use node-gyp to build the module.

npm install iltorb

Prerequisites for Building

The following is required to build from source or when a pre-compiled binary does not exist.

Methods

Async

Omitting the callback argument will result in the compress and decompress methods to return a Promise.

compress(buffer[, brotliEncodeParams][, callback])

const compress = require('iltorb').compress;

// callback style
compress(input, function(err, output) {
  // ...
});

// promise style
compress(input)
  .then(output => /* ... */)
  .catch(err => /* ... */);

// async/await style
try {
  const output = await compress(input);
} catch(err) {
  // ...
}

decompress(buffer[, callback])

const decompress = require('iltorb').decompress;

// callback style
decompress(input, function(err, output) {
  // ...
});

// promise style
decompress(input)
  .then(output => /* ... */)
  .catch(err => /* ... */);

// async/await style
try {
  const output = await decompress(input);
} catch(err) {
  // ...
}

Sync

compressSync(buffer[, brotliEncodeParams])

const compressSync = require('iltorb').compressSync;

try {
  var output = compressSync(input);
} catch(err) {
  // ...
}

decompressSync(buffer)

const decompressSync = require('iltorb').decompressSync;

try {
  var output = decompressSync(input);
} catch(err) {
  // ...
}

Stream

compressStream([brotliEncodeParams])

const compressStream = require('iltorb').compressStream;
const fs = require('fs');

fs.createReadStream('path/to/input')
  .pipe(compressStream())
  .pipe(fs.createWriteStream('path/to/output'));
compressionStream.flush()

Call this method to flush pending data. Don't call this frivolously, premature flushes negatively impact the effectiveness of the compression algorithm.

decompressStream()

const decompressStream = require('iltorb').decompressStream;
const fs = require('fs');

fs.createReadStream('path/to/input')
  .pipe(decompressStream())
  .pipe(fs.createWriteStream('path/to/output'));

brotliEncodeParams

The compress, compressSync and compressStream methods may accept an optional brotliEncodeParams object to define some or all of brotli's compression parameters:

const brotliEncodeParams = {
  mode: 0,
  quality: 11,
  lgwin: 22,
  lgblock: 0,
  disable_literal_context_modeling: false,
  size_hint: 0, // automatically set for `compress` and `compressSync`
  large_window: false,
  npostfix: 0,
  ndirect: 0
};

Troubleshooting

  1. I am unable to install iltorb because the host (GitHub) that serves the binaries is blocked by my firewall.

    a) By default, if the binaries could not be downloaded for any reason, the install script will attempt to compile the binaries locally on your machine. This requires having all of the build requirements fulfilled.

    b) You can override the binary.host value found in package.json with the following methods:

    • using the following ENV variable npm_config_iltorb_binary_host=https://domain.tld/path
    • as an additional argument with npm install --iltorb_binary_host=https://domain.tld/path

    Note: Both of these would result in downloading the binary from https://domain.tld/path/vX.X.X/iltorb-vX.X.X-node-vXX-arch.tar.gz

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].