{"id":15789597,"url":"https://github.com/transitive-bullshit/parse-email","last_synced_at":"2025-05-12T13:46:32.635Z","repository":{"id":47407924,"uuid":"132799643","full_name":"transitive-bullshit/parse-email","owner":"transitive-bullshit","description":"Parses mime-encoded email messages.","archived":false,"fork":false,"pushed_at":"2022-02-11T05:37:52.000Z","size":450,"stargazers_count":4,"open_issues_count":11,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-20T01:08:35.254Z","etag":null,"topics":["email","email-parser","email-parsing","mail","mime","multipart","parser"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transitive-bullshit.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-09T18:46:58.000Z","updated_at":"2024-07-17T13:57:27.000Z","dependencies_parsed_at":"2022-08-23T00:10:40.589Z","dependency_job_id":null,"html_url":"https://github.com/transitive-bullshit/parse-email","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fparse-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fparse-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fparse-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fparse-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transitive-bullshit","download_url":"https://codeload.github.com/transitive-bullshit/parse-email/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252723650,"owners_count":21794346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","email-parser","email-parsing","mail","mime","multipart","parser"],"created_at":"2024-10-04T22:02:29.289Z","updated_at":"2025-05-12T13:46:32.609Z","avatar_url":"https://github.com/transitive-bullshit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parse-email\n\n\u003e Parses mime-encoded email messages.\n\n[![NPM](https://img.shields.io/npm/v/parse-email.svg)](https://www.npmjs.com/package/parse-email) [![Build Status](https://travis-ci.com/transitive-bullshit/parse-email.svg?branch=master)](https://travis-ci.com/transitive-bullshit/parse-email) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\n## Install\n\n```bash\nnpm install --save parse-email\n```\n\n\n## Usage\n\n```js\nconst parse = require('parse-email')\nconst fs = require('fs')\nconst input = fs.readFileSync('./fixtures/0.txt', 'utf8')\n\nparse(input)\n  .then((email) =\u003e {\n    console.log(email)\n  })\n```\n\nExample parsed output:\n\n```json\n{\n  \"attachments\": [ ... ],\n  \"headers\": { ... },\n  \"html\": \"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e...\u003c/html\u003e\",\n  \"text\": \"...\",\n  \"textAsHtml\": \"\u003cp\u003e...\u003c/p\u003e\",\n  \"subject\": \"Example email subject\",\n  \"date\": \"2018-05-09T14:17:02.000Z\",\n  \"to\": {\n    \"value\": [\n      {\n        \"address\": \"fischxxxx@gmail.com\",\n        \"name\": \"Travis Fischer\"\n      }\n    ],\n    \"html\": \"\u003cspan class=\\\"mp_address_name\\\"\u003eTravis Fischer\u003c/span\u003e \u0026lt;\u003ca href=\\\"mailto:fischxxxx@gmail.com\\\" class=\\\"mp_address_email\\\"\u003efischxxxx@gmail.com\u003c/a\u003e\u0026gt;\",\n    \"text\": \"Travis Fischer \u003cfischxxxx@gmail.com\u003e\"\n  },\n  \"from\": {\n    \"value\": [\n      {\n        \"address\": \"courses-xxxxxx@theblockchainacademy.com\",\n        \"name\": \"Bryant Nielson\"\n      }\n    ],\n    \"html\": \"\u003cspan class=\\\"mp_address_name\\\"\u003eBryant Nielson\u003c/span\u003e \u0026lt;\u003ca href=\\\"mailto:courses-xxxxxx@theblockchainacademy.com\\\" class=\\\"mp_address_email\\\"\u003ecourses-xxxxxx@theblockchainacademy.com\u003c/a\u003e\u0026gt;\",\n    \"text\": \"Bryant Nielson \u003ccourses-xxxxxx@theblockchainacademy.com\u003e\"\n  },\n  \"messageId\": \"\u003c01.B3.11399.xxxxxxxx@momentum1-mta1\u003e\"\n}\n```\n\n\n## API\n\n### parse(input)\n\nReturns: `Promise\u003cObject\u003e`\n\nParses the given input string as a mime-encoded email.\n\n#### input\n\nType: `String`\n**Required**\n\nMime-encoded email string to parse.\n\n\n## Related\n\n- [@nodemailer/mailparser2](https://yarnpkg.com/en/package/@nodemailer/mailparser2) - Mail parser used under the hood.\n- [@nodemailer/mailparser](https://github.com/nodemailer/mailparser) - Deprecated mail parser.\n- [emailjs-mime-parser](https://github.com/emailjs/emailjs-mime-parser) - Parse a mime tree, no magic included.\n- [nylas-mail](https://github.com/nylas/nylas-mail) - An extensible desktop mail app built on the modern web.\n\n\n## License\n\nNote: this module relies on [@nodemailer/mailparser2](https://yarnpkg.com/en/package/@nodemailer/mailparser2) which has a more restrictive license.\n\nMIT © [Travis Fischer](https://github.com/transitive-bullshit)\n\nSupport my OSS work by \u003ca href=\"https://twitter.com/transitive_bs\"\u003efollowing me on twitter \u003cimg src=\"https://storage.googleapis.com/saasify-assets/twitter-logo.svg\" alt=\"twitter\" height=\"24px\" align=\"center\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Fparse-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransitive-bullshit%2Fparse-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Fparse-email/lists"}