Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mat-sz/lettercoder
✉️ Isomorphic Quoted-Printable (RFC 2045) and MIME word (RFC 2047) decoding library.
https://github.com/mat-sz/lettercoder
email javascript javascript-library mail mime quoted-printable typescript typescript-library
Last synced: 2 months ago
JSON representation
✉️ Isomorphic Quoted-Printable (RFC 2045) and MIME word (RFC 2047) decoding library.
- Host: GitHub
- URL: https://github.com/mat-sz/lettercoder
- Owner: mat-sz
- License: bsd-3-clause-clear
- Created: 2020-04-03T17:29:20.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-22T18:41:36.000Z (12 months ago)
- Last Synced: 2024-11-06T11:02:48.019Z (3 months ago)
- Topics: email, javascript, javascript-library, mail, mime, quoted-printable, typescript, typescript-library
- Language: TypeScript
- Size: 166 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
lettercoder**lettercoder** is an isomorphic decoding library for e-mail related applications written in TypeScript.
The following RFCs are supported by lettercoder:
- [RFC 2045](https://tools.ietf.org/html/rfc2045.html) (Quoted-Printable)
- [RFC 2047](https://tools.ietf.org/html/rfc2047.html) (MIME Words)## Usage
### String with mixed MIME words and regular words (RFC 2047)
```ts
import { decodeMimeWords } from 'lettercoder';decodeMimeWords('=?ISO-8859-1?Q?a?= b'); // a b
```### One MIME word (RFC 2047)
```ts
import { decodeMimeWord } from 'lettercoder';decodeMimeWords('=?ISO-8859-1?Q?a?='); // a
```### Quoted-Printable: UTF-8 (RFC 2045)
```ts
import { decodeQuotedPrintable } from 'lettercoder';decodeQuotedPrintable('=F0=9F=91=8D', 'utf-8'); // 👍
```### Quoted-Printable: Byte array (RFC 2045)
```ts
import { decodeQuotedPrintable } from 'lettercoder';decodeQuotedPrintable('=DE=AD=BE=EF'); // Uint8Array(4) [ 222, 173, 190, 239 ]
```