# eml-parse-js **Repository Path**: scottcoder/eml-parse-js ## Basic Information - **Project Name**: eml-parse-js - **Description**: https://github.com/MQpeng/eml-parse-js - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-08-21 - **Last Updated**: 2025-11-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # eml-parse-js [RFC 822](https://www.w3.org/Protocols/rfc822/) EML file format parser and builder, Can be used in browser environment > fork from `eml-format-js`(used in Browser env) & `eml-format` (used in NodeJs env) 1. fix `eml-format-js` for parsing html from the eml with `quoted-printable` 2. add `data` with `base64` in attachment ## start guide ```javascript import { parseEml, readEml, GBKUTF8, decode } from 'eml-parse-js'; // const eml = await axios(http | ajax).get() // `.eml` file readEml(eml, (err, ReadEmlJson) => { }); ``` ## @types ```typescript interface Attachment { name: string; contentType: string; inline: boolean; data: string | Uint8Array; data64: string; filename?: string; mimeType?: string; id?: string; cid?: string; } interface ReadEmlJson { attachments: Attachment date: Date | string; subject: string; from: EmailAddress | EmailAddress[] | null; to: EmailAddress | EmailAddress[] | null; cc?: EmailAddress | EmailAddress[] | null; headers: EmlHeaders; multipartAlternative?: { 'Content-Type': string; }; text?: string; textheaders?: BoundaryHeaders; html?: string; // email html data htmlheaders?: BoundaryHeaders; attachments?: Attachment[]; data?: string; } ```