{"id":13577881,"url":"https://github.com/undergroundwires/safe-email","last_synced_at":"2025-08-08T17:47:01.171Z","repository":{"id":42827747,"uuid":"266348902","full_name":"undergroundwires/safe-email","owner":"undergroundwires","description":"🛡️📧 Protect e-mails against spam and scraping bots","archived":false,"fork":false,"pushed_at":"2025-01-18T12:22:33.000Z","size":2114,"stargazers_count":31,"open_issues_count":4,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-17T22:44:34.913Z","etag":null,"topics":["anti-spam","email-obfuscation","email-obfuscator","email-privacy","html","javascript","javascript-library","no-dependencies","npm-package"],"latest_commit_sha":null,"homepage":"https://safe-email.netlify.app","language":"JavaScript","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/undergroundwires.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-05-23T14:06:23.000Z","updated_at":"2025-03-07T06:22:36.000Z","dependencies_parsed_at":"2024-01-16T20:28:22.261Z","dependency_job_id":"a83bbfdb-8cb3-43a3-8d3f-7639eb740236","html_url":"https://github.com/undergroundwires/safe-email","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undergroundwires%2Fsafe-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undergroundwires%2Fsafe-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undergroundwires%2Fsafe-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undergroundwires%2Fsafe-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/undergroundwires","download_url":"https://codeload.github.com/undergroundwires/safe-email/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244764520,"owners_count":20506653,"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":["anti-spam","email-obfuscation","email-obfuscator","email-privacy","html","javascript","javascript-library","no-dependencies","npm-package"],"created_at":"2024-08-01T15:01:25.142Z","updated_at":"2025-03-21T08:30:33.145Z","avatar_url":"https://github.com/undergroundwires.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# safe-email\n\n\u003e 🛡️📧 Protect e-mails against spam and scraping bots\n\n[![](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/undergroundwires/safe-email/issues)\n[![](https://github.com/undergroundwires/safe-email/workflows/Publish/badge.svg)](./.github/workflows/publish.yaml)\n[![](https://github.com/undergroundwires/safe-email/workflows/Build%20\u0026%20test/badge.svg)](./.github/workflows/build-and-test.yaml)\n[![](https://github.com/undergroundwires/safe-email/workflows/Bump%20\u0026%20release/badge.svg)](./.github/workflows/bump-and-release.yaml)\n[![](https://github.com/undergroundwires/safe-email/workflows/Quality%20checks/badge.svg)](./.github/workflows/quality-checks.yaml)\n[![](https://img.shields.io/npm/v/safe-email)](https://www.npmjs.com/package/safe-email)\n[![Auto-versioned by bump-everywhere](https://github.com/undergroundwires/bump-everywhere/blob/master/badge.svg?raw=true)](https://github.com/undergroundwires/bump-everywhere)\n\u003c!-- [![](https://img.shields.io/npm/dm/safe-email)](https://www.npmjs.com/package/safe-email)\n[![](https://data.jsdelivr.com/v1/package/npm/safe-email/badge?style=rounded)](https://www.jsdelivr.com/package/npm/safe-email) --\u003e\n\nEasy way to obfuscate e-mails to have spam protection against scraping bots.\n\n- Vanilla JavaScript only ✔️\n- Very lightweight with no dependencies ✔️\n- Easy to configure by using HTML attributes ✔️\n\n## How it works 🛡️\n\n- Base64 encoding of e-mail\n- CSS tricks to show the right text only to humans\n- Obfuscating HTML text of the e-mail\n\n## Import\n\n### Option A: Use CDN\n\nIt's the simplest way. Just add it to your page:\n\n```html\n\u003cscript\n  type=\"text/javascript\"\n  src=\"https://cdn.jsdelivr.net/npm/safe-email@1.1.1/dist/safe-email.min.js\"\n  defer\n  async\n\u003e\n\u003c/script\u003e\n```\n\n### Option B: Install\n\n- Using NPM (recommended): `npm install safe-email --save`\n- Using bower: `bower install undergroundwires/safe-email`\n- As a git submodule:\n  - Go to the folder you wish to have the repository\n  - Run `git submodule add https://github.com/undergroundwires/safe-email`\n- ❗ Only CDN and NPM solutions will have minified files with polyfills (`dist/` folder)\n\n```html\n\u003cscript\n  type=\"text/javascript\"\n  src=\"/node_modules/safe-email/dist/safe-email.min.js\"\n  defer\n  async\n\u003e\u003c/script\u003e\n```\n\n*[top↑](#safe-email)*\n\n## Usage\n\n### Encode your e-mail\n\nYou'll need to base64 encode to get an obfuscated value for it. Feel free to use your own favorite tool or [safe-email generator](https://safe-email.netlify.app/) to base64 encode your e-mail.\n\n### Examples\n\n#### Simplest\n\n```html\n  \u003ca title=\"Email\" href=\"#\" data-email_b64=\"dW5kZXJncm91bmR3aXJlc0BnaXRodWIuY29t\"\u003e\u003c/a\u003e\n```\n\n[See it live on CodePen](https://codepen.io/undergroundwires/pen/XWbLMOL)\n\n#### With all properties\n\n```html\n  \u003ca title=\"Email\" href=\"#\" data-email_b64=\"dW5kZXJncm91bmR3aXJlc0BnaXRodWIuY29t\"\n    data-body=\"Hello!\" data-subject=\"About website\"\u003e\u003c/a\u003e\n```\n\n[See it live on CodePen](https://codepen.io/undergroundwires/pen/MWwMpRL)\n\n#### With icon\n\n```html\n\u003ca title=\"Email\" href=\"#\" data-email_b64=\"dW5kZXJncm91bmR3aXJlc0BnaXRodWIuY29t\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M4 4h16c1.1.1 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1.1-2-.9-2-2V6c0-1.1.9-2 2-2z\"\u003e\u003c/path\u003e\u003cpolyline points=\"22,6 12,13 2,6\"\u003e\u003c/polyline\u003e\u003c/svg\u003e\n\u003c/a\u003e\n```\n\n[See it live on CodePen](https://codepen.io/undergroundwires/pen/GRJbWaE)\n\nAs icon is an inner HTML of the parent `\u003ca\u003e` your e-mail will not be rendered.\n\n### Properties\n\n| Property | Explanation | Required / Default |\n| -------- | ----------- | -------- |\n| **`data-email_b64`** | Base64 encoded text of your e-mail. You can encode your e-mail [here](https://safe-email.netlify.app/). | Required |\n|  **`data-body`** | Body of the e-mail | Optional, Defaults to `Hi!` |\n|  **`data-subject`** | Subject of the e-mail | Optional,  Defaults to root domain name + path, e.g. `abc.com/path` |\n\nAny element that has **`data-email_b64`** property defined will have obfuscated `mailto:` pointing to the given e-mail address. If owner element of this property has no inner HTML, then the e-mail (in obfuscated form) will be rendered.\n\n*[top↑](#safe-email)*\n\n## Package contents\n\nThe deployed packages includes a `dist/` folder that adds polyfills to the files and distributes them as:\n\n- minified (`.min.js`) files for production usage\n- non-minified (`.js`) files for debugging\n\n*[top↑](#safe-email)*\n\n## GitOps\n\nCI/CD is fully automated for this repo using different Git events \u0026 GitHub actions.\n\n![safe-email continuous integration and deployment flow](./img/gitops.png)\n\n*[top↑](#safe-email)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundergroundwires%2Fsafe-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fundergroundwires%2Fsafe-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundergroundwires%2Fsafe-email/lists"}