{"_id":"@carlgo11/simpleimfparser","_rev":"3-9f4b9a42449ffea92809bc869acaab4f","name":"@carlgo11/simpleimfparser","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.0":{"name":"@carlgo11/simpleimfparser","version":"0.0.0","_id":"@carlgo11/simpleimfparser@0.0.0","maintainers":[{"name":"carlgo11","email":"npmjs.com@carlgo11.com"}],"dist":{"shasum":"b79a8febe7973149bc8c82edd6a88692b53f9207","tarball":"https://registry.npmjs.org/@carlgo11/simpleimfparser/-/simpleimfparser-0.0.0.tgz","fileCount":16,"integrity":"sha512-g00D0h2/vZP3qqNaL+KVLYa9L0m2CUmRvo0s1wFeMRAK9mtTtKPb5MTmc7PBDhIDV28gsn0feLXyQwsfq//rRw==","signatures":[{"sig":"MEQCIGY8kx3/8BFuUHSw8WCSqL9fp9GXoYg2FTwhn4kQll/YAiB5wL5fzTzhg3UXSLRcwWSiTa0e0hdUDH2xVBkNiZL6lA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46672},"main":"src/index.ts","type":"module","gitHead":"b8f1fc7226868218b20484fddb575f83964a4267","private":false,"scripts":{"test":"node --import tsx --test test/*.test.ts test/**/*.test.ts","start":"node src/index.ts"},"_npmUser":{"name":"carlgo11","email":"npmjs.com@carlgo11.com"},"_npmVersion":"10.8.3","directories":{},"_nodeVersion":"20.12.2","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","ts-node":"^10.9.2","typescript":"^5.7.3","@types/node":"^22.10.7","@faker-js/faker":"^9.4.0"},"_npmOperationalInternal":{"tmp":"tmp/simpleimfparser_0.0.0_1737506120008_0.5158942645117268","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@carlgo11/simpleimfparser","version":"0.0.1","author":{"name":"Carlgo11"},"license":"GPL-3.0","_id":"@carlgo11/simpleimfparser@0.0.1","maintainers":[{"name":"carlgo11","email":"npmjs.com@carlgo11.com"}],"homepage":"https://github.com/carlgo11/SimpleIMFParser#readme","bugs":{"url":"https://github.com/carlgo11/SimpleIMFParser/issues"},"dist":{"shasum":"ab018c057681005c37c7034fecbed94d28083d06","tarball":"https://registry.npmjs.org/@carlgo11/simpleimfparser/-/simpleimfparser-0.0.1.tgz","fileCount":39,"integrity":"sha512-8UM0Fd5fHql1ZsvD4k7iRkWa6+oSNP8EstvJCmsquol4US/T2DePlPl+V2wSaodqE0dzBa9bJFnsaUcBmUm2CA==","signatures":[{"sig":"MEUCICKMLZe0OMQ1LPA/CI01JT9fNU8lPGtVScfwSmk6TvnsAiEAgb5iv3AK/EN9DKmd4QBHrmcCNRNB/PxYQQKItiEv79c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69780},"main":"dist/index.js","type":"module","engines":{"node":">=20"},"gitHead":"0a517a9657812c4c8ce9aa86614d381e40197c67","private":false,"scripts":{"test":"node --import tsx --test test/*.test.ts test/**/*.test.ts","build":"npx tsc","start":"node src/index.ts"},"_npmUser":{"name":"carlgo11","email":"npmjs.com@carlgo11.com"},"repository":{"url":"git+https://github.com/carlgo11/SimpleIMFParser.git","type":"git"},"_npmVersion":"10.9.2","description":"Simple IMF parser","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","ts-node":"^10.9.2","typescript":"^5.7.3","@types/node":"^22.10.7","@faker-js/faker":"^9.4.0"},"_npmOperationalInternal":{"tmp":"tmp/simpleimfparser_0.0.1_1737762624101_0.9931024365742527","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-a":{"name":"@carlgo11/simpleimfparser","version":"0.0.1-a","author":{"name":"Carlgo11"},"license":"GPL-3.0","_id":"@carlgo11/simpleimfparser@0.0.1-a","maintainers":[{"name":"carlgo11","email":"npmjs.com@carlgo11.com"}],"homepage":"https://github.com/carlgo11/SimpleIMFParser#readme","bugs":{"url":"https://github.com/carlgo11/SimpleIMFParser/issues"},"dist":{"shasum":"b0a1ac833a9c281f631e16665e003f29fd9bd6c9","tarball":"https://registry.npmjs.org/@carlgo11/simpleimfparser/-/simpleimfparser-0.0.1-a.tgz","fileCount":28,"integrity":"sha512-SPS6hrjOze8724z0xB/6zwMGTjo8x98lYSaAR9h2NqG71o6BBaSH0MENX39YwKsS+sUtH9JkSFyY06gFaR8YxA==","signatures":[{"sig":"MEUCIDyVxSUWpZi12gxgSLtmHTYOrhnZQvJrzncm4N5SLMBYAiEA/KG1Po5g4Fx/1xX78bJ4e5BRipjIPx/RB/5YlhEtFXc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56466},"main":"dist/index.js","type":"module","engines":{"node":">=20"},"gitHead":"43a8ca68b8b8ac9155eabb17f9d7206b51ae7ea3","private":false,"scripts":{"test":"node --import tsx --test test/*.test.ts test/**/*.test.ts","build":"npx tsc","start":"node src/index.ts"},"_npmUser":{"name":"carlgo11","email":"npmjs.com@carlgo11.com"},"repository":{"url":"git+https://github.com/carlgo11/SimpleIMFParser.git","type":"git"},"_npmVersion":"10.9.2","description":"Simple IMF parser","directories":{},"_nodeVersion":"22.13.0","dependencies":{"@types/node":"^22.10.7"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","ts-node":"^10.9.2","typescript":"^5.7.3","@faker-js/faker":"^9.4.0"},"_npmOperationalInternal":{"tmp":"tmp/simpleimfparser_0.0.1-a_1737764365747_0.7995395178467688","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"type":"module","main":"dist/index.js","types":"dist/index.d.ts","name":"@carlgo11/simpleimfparser","description":"Simple IMF parser","version":"0.0.2","license":"MIT","author":{"name":"Carlgo11"},"repository":{"type":"git","url":"git+https://github.com/carlgo11/SimpleIMFParser.git"},"bugs":{"url":"https://github.com/carlgo11/SimpleIMFParser/issues"},"homepage":"https://github.com/carlgo11/SimpleIMFParser#readme","scripts":{"start":"node src/index.ts","test":"node --import tsx --test test/*.test.ts test/**/*.test.ts","build":"npx tsc","docs":"npx typedoc"},"private":false,"dependencies":{"@types/node":"^22.10.7","validator":"^13.12.0"},"devDependencies":{"@faker-js/faker":"^9.4.0","@types/validator":"^13.12.2","esbuild":"^0.24.2","jsdoc":"^4.0.4","ts-node":"^10.9.2","tsx":"^4.19.2","typedoc":"^0.27.6","typedoc-plugin-merge-modules":"^6.1.0","typescript":"^5.7.3"},"engines":{"node":">=20"},"_id":"@carlgo11/simpleimfparser@0.0.2","gitHead":"11618b54e74d1a3a00a86a6d821faff08c8dabdf","_nodeVersion":"22.13.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-6h2Nm1R43X/GuzkwhSPRPBZ9q7The3Mia8P9HPb7d3KEUuhiEV5Sfho6Cw8rZdfVbasxbcnzGDD7iQBhnR5RlQ==","shasum":"dbaf4c0d1dd419504a07e7292c83c54d5f9d243f","tarball":"https://registry.npmjs.org/@carlgo11/simpleimfparser/-/simpleimfparser-0.0.2.tgz","fileCount":21,"unpackedSize":18220,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGecA7favbroasnfowR0hWgVsg6QNRZPKry8QSkO6fThAiEAqqyGiprK096Yp+3rT7XB1vCc477YfFbEIQljrA8tFLE="}]},"_npmUser":{"name":"carlgo11","email":"npmjs.com@carlgo11.com"},"directories":{},"maintainers":[{"name":"carlgo11","email":"npmjs.com@carlgo11.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/simpleimfparser_0.0.2_1738014045894_0.0744769564518255"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-22T00:35:19.943Z","modified":"2025-01-27T21:40:46.276Z","0.0.0":"2025-01-22T00:35:20.220Z","0.0.1":"2025-01-24T23:50:24.308Z","0.0.1-a":"2025-01-25T00:19:25.980Z","0.0.2":"2025-01-27T21:40:46.089Z"},"bugs":{"url":"https://github.com/carlgo11/SimpleIMFParser/issues"},"author":{"name":"Carlgo11"},"license":"MIT","homepage":"https://github.com/carlgo11/SimpleIMFParser#readme","repository":{"type":"git","url":"git+https://github.com/carlgo11/SimpleIMFParser.git"},"description":"Simple IMF parser","maintainers":[{"name":"carlgo11","email":"npmjs.com@carlgo11.com"}],"readme":"# Simple IMF Parser\n\nA TypeScript library for parsing Internet Message Format (IMF) emails, extracting headers, envelope details, and message bodies while providing useful utilities for email manipulation.\n\n## Features\n- Parses raw IMF emails from **string** or **stream** input\n- Supports **header parsing** (including multi-line folding)\n- Provides a structured **Email class** with helper functions:\n  - `getHeader(name)` – Retrieve a header\n  - `addHeader(name, value)` – Add a new header\n  - `removeHeader(name)` – Remove a header\n  - `getBody()` – Get the email body\n- Handles **multiple headers** with the same name (e.g., `Received` headers)\n- Supports **UTF-8 names & addresses** (RFC 6532)\n\n## Installation\n```sh\nnpm install @carlgo11/simpleimfparser\n```\n\n## Usage\n\n### Parsing an Email\n```ts\nimport parseEmail from '@carlgo11/simpleimfparser';\nimport fs from 'fs';\n\n(async () => {\n  const rawData = fs.readFileSync('test-email.eml', 'utf-8');\n  const envelope = {\n    from: 'alice@example.com',\n    to: ['bob@example.com'],\n    senderIP: '192.168.1.1'\n  };\n\n  const email = await parseEmail(rawData, envelope);\n  \n  console.log('Subject:', email.getHeader('subject'));\n  console.log('Body:', email.getBody());\n})();\n```\n\n### Working with Headers\n```ts\nemail.addHeader('X-Custom-Header', 'Hello World');\nemail.removeHeader('Received');\nconsole.log(email.getHeader('from'));\n```\n\n### Extracting Envelope Details\n```ts\nconsole.log(email.envelope.senderIP); // 192.168.1.1\nconsole.log(email.envelope.to); // ['bob@example.com']\n```\n\n### Recompiling Email Object to IMF Format\n```ts\nemail.toString();\n```","readmeFilename":"README.md"}