unstale

npm / libmime

libmime

What changed in libmime 3 to 5, from its official release notes, upgrade guides and advisories. Also covers @types/libmime. Sources checked 2026-11-30.

2 breaking2 security3 new APIs and options2 performance1 tooling22 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

libmime 531 changes

Breaking changes 1

  • All iconv-lite aliases of the utf-7, base64, and hex codecs are refused as charsets.

    5.5.0release notes

Security 2

  • Control characters are dropped from header values and parameter names.

    5.5.0release notes

  • Header parsing was hardened against prototype pollution and parser differentials.

    5.4.2release notes

New APIs and options 3

  • Adds a stream for decoding a body in any charset.

    5.6.0release notes

  • Adds the skipPrototypeKeys option to decodeHeaders().

    5.6.0release notes

  • Exposes normalizeCharset() on the public API.

    5.4.0release notes

Performance 2

  • Long non-ASCII words are encoded in linear time, improving encoding performance.

    5.4.9release notes

  • Flowed decoding and header unfolding now run in linear time.

    5.4.5release notes

Tooling 1

  • The project migrated to TypeScript and now provides ES module and CommonJS builds.

    5.5.0release notes

Fixes and other changes 22

  • Drops text following a closed quoted string up to the next parameter.

    5.6.3release notes

  • Continues the token of a parameter value when a parenthesis appears immediately after the equals sign.

    5.6.2release notes

  • The first value of a duplicated parameter is kept.

    5.6.1release notes

  • With stripComments enabled, comments are dropped from a MIME header value.

    5.6.1release notes

  • Resolves the x-mac charset labels and Big5-HKSCS.

    5.6.0release notes

  • Reads the byte order of UTF-16 from the BOM.

    5.6.0release notes

  • Decoding format=flowed now respects quote depth.

    5.5.2release notes

  • Parameter values that look like encoded words are now encoded.

    5.5.1release notes

  • Astral characters outside the emoji block are kept whole when encoded.

    5.5.0release notes

  • Continuation lines created by encodeFlowed are space-stuffed, and spaces before hard line breaks are trimmed.

    5.5.0release notes

  • Chunks of a Buffer passed to encodeWord are now base64-encoded only once.

    5.5.0release notes

  • Space stuffing is removed from format=flowed continuation lines.

    5.5.0release notes

  • Control characters and DEL are encoded in header parameter values.

    5.5.0release notes

  • Empty header parameter values are quoted.

    5.5.0release notes

  • Unpaired surrogates are encoded instead of leaving delimiters unencoded.

    5.5.0release notes

  • The pyc and ccxml entries are corrected, and common modern MIME types are added.

    5.5.0release notes

  • Every continuation holding percent escapes is marked as encoded.

    5.5.0release notes

  • Malformed input no longer causes splitMimeEncodedString to loop forever.

    5.5.0release notes

  • RFC 2231 parameters are marked as decoded.

    5.4.9release notes

  • Transfer-encoding codecs are refused when used as charsets.

    5.4.9release notes

  • B-encoded words are decoded through libbase64.

    5.4.6release notes

  • charset.decode returns a string for Japanese encodings.

    5.3.8release notes

libmime 31 changes

Breaking changes 1

  • Encoded-word generation now encodes from the first word with Unicode characters to the last, avoiding non-encoded parts between encoded words.

    3.0.0release notes