{"id":23072534,"url":"https://github.com/oreqr/email-viewer","last_synced_at":"2026-05-15T11:37:08.529Z","repository":{"id":246403152,"uuid":"820410047","full_name":"OreQr/email-viewer","owner":"OreQr","description":"📧Opens browser with email preview","archived":false,"fork":false,"pushed_at":"2024-11-20T11:47:22.000Z","size":125,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T05:27:47.663Z","etag":null,"topics":["automation","devtool","email","mail","mailer","nodejs","nodemailer","preview","smtp","viewer"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/email-viewer","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OreQr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-26T12:14:16.000Z","updated_at":"2024-11-20T11:47:25.000Z","dependencies_parsed_at":"2024-06-27T20:33:00.699Z","dependency_job_id":"ffb6c7c5-cbd3-4ce4-bd1a-6f1d321d8e96","html_url":"https://github.com/OreQr/email-viewer","commit_stats":null,"previous_names":["oreqr/email-viewer"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/OreQr/email-viewer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OreQr%2Femail-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OreQr%2Femail-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OreQr%2Femail-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OreQr%2Femail-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OreQr","download_url":"https://codeload.github.com/OreQr/email-viewer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OreQr%2Femail-viewer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33065719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["automation","devtool","email","mail","mailer","nodejs","nodemailer","preview","smtp","viewer"],"created_at":"2024-12-16T07:20:27.157Z","updated_at":"2026-05-15T11:37:08.513Z","avatar_url":"https://github.com/OreQr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Email viewer\n\n![NPM Version](https://img.shields.io/npm/v/email-viewer?style=flat-square)\n![NPM Downloads](https://img.shields.io/npm/dw/email-viewer?style=flat-square)\n![License](https://img.shields.io/github/license/oreqr/email-viewer?style=flat-square)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\nOpens browser with email preview by rendering HTML file using bundled EJS template.\n\n## Preview\n\nEmail example from [React Email](https://react.email)\n\n![image](https://github.com/OreQr/email-viewer/assets/50458706/ab9de2a3-5bdd-4e58-bb99-41072cea173f)\n\n## Installation\n\n```bash\nnpm install email-viewer\n```\n\n## Example usage\n\nHere is an example of how to use the `viewEmail` function:\n\n```typescript\nconst message = {\n  subject: \"test subject\",\n  text: \"Hello, world!\",\n}\n\nif (process.env.NODE_ENV === \"development\") {\n  return import(\"email-viewer\").then(({ viewEmail }) =\u003e viewEmail(message))\n}\n```\n\n## Options\n\nThe `viewEmail` function accepts an object with the following properties:\n\n### ViewEmailOptions\n\n| Property | Type                 | Description                                                                                         | Default        |\n| -------- | -------------------- | --------------------------------------------------------------------------------------------------- | -------------- |\n| id       | `string`             | ID of the email. If not provided, a random UUID will be generated.                                  | `randomUUID()` |\n| dir      | `string`             | Directory where the HTML file will be saved. If open is set to false, the file will not be created. | `os.tmpdir()`  |\n| open     | `boolean`            | Whether to automatically open the rendered HTML file in the default browser.                        | `true`         |\n| subject  | `string`             | Subject of the email.                                                                               | `undefined`    |\n| from     | `string`             | Sender of the email.                                                                                | `undefined`    |\n| to       | `string \\| string[]` | Recipient(s) of the email.                                                                          | `undefined`    |\n| html     | `string`             | HTML content of the email.                                                                          | `undefined`    |\n| text     | `string`             | Plain text content of the email.                                                                    | `undefined`    |\n\n## Result\n\nThe `viewEmail` function returns an object with the following properties:\n\n### ViewEmailResult\n\n| Property | Type     | Description            |\n| -------- | -------- | ---------------------- |\n| id       | `string` | ID of the email.       |\n| html     | `string` | Rendered HTML content. |\n\n## License\n\n[MIT](https://github.com/OreQr/email-viewer/blob/main/LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foreqr%2Femail-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foreqr%2Femail-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foreqr%2Femail-viewer/lists"}