Skip to content

Commit 25342f3

Browse files
committed
docs: use GitHub markdown alerts instead of manual formatting
- Replace manual **Tip** blockquote with [!TIP] alert - Add [!NOTE] alert in TypeScript Support section explaining type validation - Add [!IMPORTANT] alert highlighting security features (maxNestingDepth, maxHeadersSize) GitHub markdown alerts provide better visual styling and semantic meaning.
1 parent cefb479 commit 25342f3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**postal-mime** is an email parsing library that runs in browser environments (including Web Workers) and serverless functions (like Cloudflare Email Workers). It takes in a raw email message (RFC822 format) and outputs a structured object containing headers, recipients, attachments, and more.
44

5-
> **Tip**
5+
> [!TIP]
66
> PostalMime is developed by the makers of [EmailEngine](https://emailengine.app/?utm_source=github&utm_campaign=imapflow&utm_medium=readme-link)—a self-hosted email gateway that provides a REST API for IMAP and SMTP servers and sends webhooks whenever something changes in registered accounts.
77
88
## Features
@@ -183,6 +183,9 @@ import type {
183183
} from 'postal-mime';
184184
```
185185

186+
> [!NOTE]
187+
> PostalMime is written in JavaScript but provides comprehensive TypeScript type definitions. All types are validated through both compile-time type checking and runtime type validation tests to ensure accuracy.
188+
186189
### Available Types
187190

188191
- **`Email`** - The main parsed email object returned by `PostalMime.parse()`
@@ -232,6 +235,9 @@ PostalMime.parse(email, options) -> Promise<Email>
232235
- **maxNestingDepth** (number, default: `256`): Maximum allowed MIME part nesting depth. Throws an error if exceeded.
233236
- **maxHeadersSize** (number, default: `2097152`): Maximum allowed total header size in bytes (default 2MB). Throws an error if exceeded.
234237

238+
> [!IMPORTANT]
239+
> The `maxNestingDepth` and `maxHeadersSize` options provide built-in security against malicious emails with deeply nested MIME structures or oversized headers that could cause performance issues or memory exhaustion.
240+
235241
**Returns**: A Promise that resolves to a structured `Email` object with the following properties:
236242

237243
- **headers**: An array of `Header` objects, each containing:

0 commit comments

Comments
 (0)