{"id":24253479,"url":"https://github.com/kukhariev/sanitize-filepath","last_synced_at":"2025-07-29T19:13:10.990Z","repository":{"id":172019266,"uuid":"648735143","full_name":"kukhariev/sanitize-filepath","owner":"kukhariev","description":"Sanitize a string for use as a filename/filepath","archived":false,"fork":false,"pushed_at":"2024-01-24T16:26:09.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T07:01:09.415Z","etag":null,"topics":["filename","filepath","sanitize"],"latest_commit_sha":null,"homepage":"","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/kukhariev.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":"2023-06-02T17:15:59.000Z","updated_at":"2023-06-09T16:50:11.000Z","dependencies_parsed_at":"2024-01-24T17:37:38.665Z","dependency_job_id":"ae1b9db8-138a-4d7e-9152-321f91331687","html_url":"https://github.com/kukhariev/sanitize-filepath","commit_stats":null,"previous_names":["kukhariev/sanitize-filepath"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukhariev%2Fsanitize-filepath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukhariev%2Fsanitize-filepath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukhariev%2Fsanitize-filepath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukhariev%2Fsanitize-filepath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kukhariev","download_url":"https://codeload.github.com/kukhariev/sanitize-filepath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241904681,"owners_count":20040020,"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":["filename","filepath","sanitize"],"created_at":"2025-01-15T03:50:49.899Z","updated_at":"2025-03-04T18:42:41.578Z","avatar_url":"https://github.com/kukhariev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sanitize-filepath\n\n[![npm version](https://badge.fury.io/js/sanitize-filepath.svg)](https://badge.fury.io/js/sanitize-filepath)\n\nSanitize a string for use as a filename/filepath.\n\n## Installation\n\n```sh\nnpm i sanitize-filepath\n```\n\n## Example\n\n```js\nimport { sanitize, sanitizePath } from 'sanitize-filepath';\n\nconst filename = sanitize('/home/user/\u003cfile\u003e.ext'); // homeuserfile.ext\n\nconst filepath = sanitizePath('/home/user/\u003cfile\u003e.ext'); // home/user/file.ext\n\n\n```\n\n## Configure\n```ts\nconst options: SanitizeOptions =  {\n    maxLength: 255, // max filename length in bytes\n    replacement: \"\" // replacement for invalid characters\n    whitespaceReplacement: undefined // replacement for spaces, tabs, and newlines\n};\n\nconst filename = sanitize('/home/user/\u003cfile\u003e.ext', options)\n```\n\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkukhariev%2Fsanitize-filepath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkukhariev%2Fsanitize-filepath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkukhariev%2Fsanitize-filepath/lists"}