OptionalallowAllow experimental or non-standard compression formats not explicitly supported by this library.
When true, compression formats from Content-Encoding headers that are not in the
default supported list will be passed to the runtime's DecompressionStream without
validation. This allows using compression formats that may not be universally supported
across all browsers.
When false (default), only universally supported formats are allowed:
gzip, deflate, br (Brotli)gzip, deflateSome compression formats are only supported in specific environments:
deflate-raw: Supported in Chromium-based browsers (Chrome, Edge) but may not work
in Firefox or Safaribr (Brotli): Future browser support may varyIf you enable this option and use deflate-raw:
Use with caution: Enabling this bypasses library validation and relies entirely on runtime error handling. If the runtime doesn't support the format, you'll get a runtime error instead of a clear validation error from this library.
// Safe mode (default): Only universally supported formats
const response = await fetch('data.csv.gz');
await parse(response); // ✓ Works in all browsers
// Experimental mode: Allow deflate-raw (Chromium-only)
const response = await fetch('data.csv'); // Content-Encoding: deflate-raw
await parse(response, { allowExperimentalCompressions: true });
// ✓ Works in Chrome/Edge
// ✗ May fail in Firefox/Safari
// Browser-aware usage
const isChromium = navigator.userAgent.includes('Chrome');
await parse(response, {
allowExperimentalCompressions: isChromium
});
OptionalcharsetYou can specify the character encoding of the binary.
TextDecoderStream is used internally.
See Encoding API Compatibility for the encoding formats that can be specified.
OptionaldecompressionIf the binary is compressed by a compression algorithm, the decompressed CSV can be parsed by specifying the algorithm.
OptionalfatalIf the binary has a invalid character, you can specify whether to throw an error.
If the property is true then a decoder will throw a TypeError
if it encounters malformed data while decoding.
If false the decoder will substitute the invalid data
with the replacement character U+FFFD (�).
See TextDecoderOptions.fatal for more information.
OptionalignoreIf the binary has a BOM, you can specify whether to ignore it.
If you specify true, the BOM will be ignored. If you specify false or not specify it, the BOM will be treated as a normal character. See TextDecoderOptions.ignoreBOM for more information about the BOM.
OptionalmaxMaximum binary size in bytes for ArrayBuffer/Uint8Array inputs.
CSV Parsing Options for binary.