{"id":16170415,"url":"https://github.com/corentinth/email-normalizer","last_synced_at":"2025-03-18T23:31:10.362Z","repository":{"id":252367990,"uuid":"840263300","full_name":"CorentinTh/email-normalizer","owner":"CorentinTh","description":"A simple package to normalize email addresses by removing dots, stripping plus signs, and handling domain renaming.","archived":false,"fork":false,"pushed_at":"2024-08-10T08:23:05.000Z","size":139,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T03:29:52.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/CorentinTh.png","metadata":{"files":{"readme":".github/readme-header.png","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-09T10:13:29.000Z","updated_at":"2025-03-09T06:38:16.000Z","dependencies_parsed_at":"2024-10-27T19:19:45.644Z","dependency_job_id":"a397f689-6651-435e-9572-6ee13b9e56f4","html_url":"https://github.com/CorentinTh/email-normalizer","commit_stats":null,"previous_names":["corentinth/email-normalizer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Femail-normalizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Femail-normalizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Femail-normalizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Femail-normalizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CorentinTh","download_url":"https://codeload.github.com/CorentinTh/email-normalizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822312,"owners_count":20353496,"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":[],"created_at":"2024-10-10T03:18:41.220Z","updated_at":"2025-03-18T23:31:10.087Z","avatar_url":"https://github.com/CorentinTh.png","language":"TypeScript","funding_links":["https://github.com/sponsors/CorentinTh"],"categories":[],"sub_categories":[],"readme":"![Email Normalizer header](./.github/readme-header.png)\n\n# Email Normalizer\n\nA simple Node.js package to normalize email addresses by removing dots, stripping plus signs, and handling domain renaming.\n\n## Features\n\n- Convert to lowercase\n- Removes dots from the email identifier for specific domains\n- Strips plus signs and the following tags\n- Renames domains (e.g., `googlemail.com` to `gmail.com`)\n- Supports common email providers like Gmail, Googlemail, Hotmail, Live, and Outlook\n- No dependencies\n- Lightweight and runtime agnostic\n- Typescript, ES6, and CommonJS support\n\n## Installation\n\nYou can install the package using `pnpm`, `npm`, or `yarn`:\n\n```bash\npnpm add email-normalizer\n# or\nnpm install email-normalizer\n# or\nyarn add email-normalizer\n```\n\n## Usage\n\nHere's how you can use the `email-normalizer` package:\n\n```javascript\nimport { normalizeEmail } from 'email-normalizer';\n\nconst email = 'User.Name+tag@gmail.com';\nconst normalizedEmail = normalizeEmail({ email });\n\nconsole.log(normalizedEmail); // Output: username@gmail.com\n```\n\nNote: An error will be thrown if the provided email address is invalid.\n\n## API\n\n### `normalizeEmail({ email: string }): string`\n\nNormalizes the provided email address based on the configured rules for various domains.\n\n**Parameters:**\n\n- `email`: The email address to be normalized.\n\n**Returns:**\n\n- A normalized email address as a string.\n\n## Configuration\n\nThe normalization rules are predefined for the following domains:\n\n- `gmail.com`: Removes dots, strips plus sign and tags.\n- `googlemail.com`: Removes dots, strips plus sign and tags, renames domain to `gmail.com`.\n- `hotmail.com`: Strips plus sign and tags.\n- `live.com`: Removes dots, strips plus sign and tags.\n- `outlook.com`: Strips plus sign and tags.\n\n## Scripts\n\nThe package.json includes several useful scripts:\n\n- `build`: Builds the package using `unbuild`.\n- `lint`: Lints the codebase using `eslint`.\n- `lint:fix`: Fixes linting errors.\n- `test`: Runs all tests.\n- `test:unit`: Runs unit tests using `vitest`.\n- `test:unit:watch`: Runs unit tests in watch mode.\n\n## Development\n\nTo contribute to this project, clone the repository and install the dependencies:\n\n```bash\ngit clone https://github.com/CorentinTh/email-normalizer.git\ncd email-normalizer\npnpm install\n```\n\nYou can then build, lint, and test the project using the provided scripts.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Funding\n\nSupport this project through [GitHub Sponsors](https://github.com/sponsors/CorentinTh).\n\n## Author\n\nDeveloped by [Corentin Th](https://github.com/CorentinTh). You can reach out via [email](mailto:corentin.thomasset74+npm@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Femail-normalizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorentinth%2Femail-normalizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Femail-normalizer/lists"}