{"id":14982071,"url":"https://github.com/gulpjs/replace-homedir","last_synced_at":"2025-10-19T11:31:24.368Z","repository":{"id":27322663,"uuid":"113374297","full_name":"gulpjs/replace-homedir","owner":"gulpjs","description":"Replace user home in a string with another string. Useful for tildifying a path.","archived":false,"fork":false,"pushed_at":"2022-01-31T00:10:17.000Z","size":13,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T15:14:42.130Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/gulpjs.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}},"created_at":"2017-12-06T22:34:07.000Z","updated_at":"2023-11-05T01:50:21.000Z","dependencies_parsed_at":"2022-07-27T09:22:44.682Z","dependency_job_id":null,"html_url":"https://github.com/gulpjs/replace-homedir","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Freplace-homedir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Freplace-homedir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Freplace-homedir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Freplace-homedir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gulpjs","download_url":"https://codeload.github.com/gulpjs/replace-homedir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236571587,"owners_count":19170650,"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-09-24T14:04:44.163Z","updated_at":"2025-10-19T11:31:19.327Z","avatar_url":"https://github.com/gulpjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://gulpjs.com\"\u003e\n    \u003cimg height=\"257\" width=\"114\" src=\"https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# replace-homedir\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]\n\nReplace user home in a string with another string. Useful for tildifying a path.\n\n## Usage\n\n```js\nvar replaceHomedir = require('replace-homedir');\n\nvar shortPath = replaceHomedir('/Users/phated/myProject', '~');\n// shortPath === '~/myProject'\n```\n\n## API\n\n### `replaceHomedir(path, replacement)`\n\nTakes a string `path` as the first argument and a string or function `replacement` as the second argument. If the `path` is absolute and begins with the User's homedir, the homedir portion of the path is replaced with `replacement` using String#replace.\n\nIf `path` is not a string, the function will throw.\n\n## License\n\nMIT\n\n\u003c!-- prettier-ignore-start --\u003e\n[downloads-image]: https://img.shields.io/npm/dm/replace-homedir.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/replace-homedir\n[npm-image]: https://img.shields.io/npm/v/replace-homedir.svg?style=flat-square\n\n[ci-url]: https://github.com/gulpjs/replace-homedir/actions?query=workflow:dev\n[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/replace-homedir/dev?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/gulpjs/replace-homedir\n[coveralls-image]: https://img.shields.io/coveralls/gulpjs/replace-homedir/master.svgstyle=flat-square\n\u003c!-- prettier-ignore-end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgulpjs%2Freplace-homedir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgulpjs%2Freplace-homedir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgulpjs%2Freplace-homedir/lists"}