Skip to main content

Compression module · API reference

Keep uncompressed formats on the same pipeline path.

NoCompressor and NoDecompressor are identity transforms. They let a format select compression at runtime without adding a special branch for the uncompressed case.

The pass-through case

Select no compression without changing the caller.

The identity implementations preserve input bytes and expose the same method names as real codecs, which keeps format code declarative and easy to test.

Compress

Returns the input unchanged

Decompress

Returns the input unchanged

Methods

Async and synchronous operations

Migration

Deprecated NoCompression remains for v5 compatibility

Detailed guide

Pass-through implementation details

The reference below documents the identity behavior, available methods, shared interface, and v5 migration note.

NoCompressor and NoDecompressor

From v5.0

NoCompressor and NoDecompressor are pass-through transforms. They let a pipeline represent an uncompressed format without a special branch.

import {NoCompressor, NoDecompressor} from '@loaders.gl/compression/none';

compress(), compressSync(), decompress(), and decompressSync() return the input unchanged. The classes implement the shared Compressor and Decompressor APIs.

The deprecated combined NoCompression class remains available for v5 migration.