eml-parser-qaap
TypeScript icon, indicating that this package has built-in type declarations

1.1.17 • Public • Published

eml-parse-vqaap

srjikMou

RFC 822 EML file format parser and builder, Can be used in browser environment

fork from eml-parse-vqaap(used in Browser env) & eml-format (used in NodeJs env)

  1. fix eml-parse-vqaap for parsing html from the eml with quoted-printable
  2. add data with base64 in attachment

start guide

import { parseEml, readEml, GBKUTF8, decode } from 'eml-parse-vqaap';

// const eml = await axios(http | ajax).get()
// `.eml` file
readEml(eml, (err, ReadEmlJson) => {});

@types

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;
}

Package Sidebar

Install

npm i eml-parser-qaap

Weekly Downloads

1

Version

1.1.17

License

MIT

Unpacked Size

322 kB

Total Files

18

Last publish

Collaborators

  • serjikmou