{"library":"mail-parser-wasm","title":"Mail Parser WebAssembly","description":"mail-parser-wasm is a specialized WebAssembly module designed for efficiently parsing raw email messages into a structured format. Leveraging WASM, it aims to offer performance benefits over pure JavaScript parsing solutions, making it suitable for resource-sensitive environments like web browsers, Node.js servers, and serverless functions (e.g., Cloudflare Workers). The package is currently at version 0.2.2, indicating it's in an early development phase, suggesting a potentially agile release cadence with features and API changes expected. Its primary differentiator is the use of WebAssembly for core parsing logic, and it provides TypeScript types for enhanced developer experience and type safety.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install mail-parser-wasm"],"cli":null},"imports":["import { parse_message } from 'mail-parser-wasm';","import type { ParsedMail } from 'mail-parser-wasm';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { parse_message } from 'mail-parser-wasm';\n\n// A raw email string in MIME format\nconst rawEmailContent = `From: sender@example.com\nTo: recipient@example.com\nSubject: Important Update\nContent-Type: text/plain; charset=\"UTF-8\"\n\nHello,\n\nThis is a test email sent from the mail-parser-wasm quickstart example.\n\nBest regards,\nThe Example Team\n`;\n\ntry {\n  const parsedEmail = parse_message(rawEmailContent);\n  console.log('--- Parsed Email Details ---');\n  console.log('Subject:', parsedEmail.subject);\n  console.log('From:', parsedEmail.from[0].address);\n  console.log('To:', parsedEmail.to[0].address);\n  console.log('Text Body:', parsedEmail.text);\n  console.log('Headers:', parsedEmail.headers.map((h: any) => `${h.key}: ${h.value}`).join('\\n'));\n} catch (error) {\n  console.error('Error parsing email:', error);\n  // Depending on the WASM module's error handling, the error might be a WebAssemblyRuntimeError\n}\n","lang":"typescript","description":"Demonstrates importing and using `parse_message` to process a raw email string, logging key components like subject, sender, recipient, and body.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}