{"id":21407432,"url":"https://github.com/palashmon/hyphen-sanitizer","last_synced_at":"2025-10-27T15:05:58.415Z","repository":{"id":232723116,"uuid":"783551665","full_name":"palashmon/hyphen-sanitizer","owner":"palashmon","description":"🚀 Simplifying text by replacing hyphens with ease","archived":false,"fork":false,"pushed_at":"2024-10-30T21:44:09.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-10T13:20:46.825Z","etag":null,"topics":["hyphen","hyphens","javascript","library","sanitize","sanitizer","string","strings","text","transform","utility"],"latest_commit_sha":null,"homepage":"","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/palashmon.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-04-08T05:49:26.000Z","updated_at":"2024-10-30T21:44:12.000Z","dependencies_parsed_at":"2024-07-26T22:53:54.395Z","dependency_job_id":null,"html_url":"https://github.com/palashmon/hyphen-sanitizer","commit_stats":null,"previous_names":["palashmon/hyphen-sanitizer"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Fhyphen-sanitizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Fhyphen-sanitizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Fhyphen-sanitizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Fhyphen-sanitizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palashmon","download_url":"https://codeload.github.com/palashmon/hyphen-sanitizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225934431,"owners_count":17547737,"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":["hyphen","hyphens","javascript","library","sanitize","sanitizer","string","strings","text","transform","utility"],"created_at":"2024-11-22T16:52:19.886Z","updated_at":"2025-10-27T15:05:58.359Z","avatar_url":"https://github.com/palashmon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hyphen-sanitizer\n\n\u003e Simplifying text by replacing hyphens with ease\n\n![CI](https://github.com/palashmon/hyphen-sanitizer/actions/workflows/main.yml/badge.svg)\n[![npm version](https://img.shields.io/npm/v/hyphen-sanitizer.svg)](http://npm.im/hyphen-sanitizer)\n[![npm downloads](https://img.shields.io/npm/dm/hyphen-sanitizer.svg)](http://npm.im/hyphen-sanitizer)\n\nHyphens are commonly used in strings to separate words or denote compound words. However, in certain scenarios, it's necessary to sanitize hyphens by replacing them with another character or removing them entirely. `hyphen-sanitizer` provides a simple yet powerful solution for sanitizing hyphens within strings, enhancing data consistency and usability.\n\n### Key Features\n\n- Sanitizes hyphens within strings\n- Allows customization of replacement string\n- Defaults to space if no replacement string is provided\n- Versatile and easy to integrate into existing projects\n\n## Install\n\n```sh\nnpm install hyphen-sanitizer\n```\n\n## Usage\n\n```js\nimport hyphenSanitizer from \"hyphen-sanitizer\";\n\n// Example 1 - Default replacement\n// Replaces hyphens with spaces\nconst text = \"Hello-world\";\nconst sanitizedText = hyphenSanitizer(text);\nconsole.log(sanitizedText); //=\u003e \"Hello world\"\n\n// Example 2 - Custom replacement\n// Replaces hyphens with underscores\nconst replacement = \"_\";\nconst sanitizedText2 = hyphenSanitizer(text, replacement);\nconsole.log(sanitizedText2); //=\u003e \"Hello_world\"\n```\n\n## API\n\n### hyphenSanitizer(input, replacement)\n\n#### input\n\nType: `string`\n\nThe input string to sanitize. This string may contain hyphens that need to be replaced.\n\n#### replacement\n\nType: `string`\u003cbr\u003e\nDefault: `' '` (space)\n\nThe replacement string to use in place of hyphens. If no replacement string is provided, hyphens will be replaced with spaces.\n\n## Related\n\n- [acronymer](https://github.com/palashmon/acronymer) - Generate acronyms from strings\n\n## License\n\nMIT © [Palash Mondal](https://github.com/palashmon)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalashmon%2Fhyphen-sanitizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalashmon%2Fhyphen-sanitizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalashmon%2Fhyphen-sanitizer/lists"}