{"id":20311101,"url":"https://github.com/mcmath/relative-path-map","last_synced_at":"2026-05-29T21:31:33.685Z","repository":{"id":57352696,"uuid":"53409279","full_name":"mcmath/relative-path-map","owner":"mcmath","description":"Configure a map of paths that may refer to each other","archived":false,"fork":false,"pushed_at":"2016-03-08T14:27:53.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T09:46:26.801Z","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/mcmath.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-08T12:10:29.000Z","updated_at":"2016-03-08T14:10:35.000Z","dependencies_parsed_at":"2022-09-16T08:21:24.670Z","dependency_job_id":null,"html_url":"https://github.com/mcmath/relative-path-map","commit_stats":null,"previous_names":["akim-mcmath/relative-path-map"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcmath%2Frelative-path-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcmath%2Frelative-path-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcmath%2Frelative-path-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcmath%2Frelative-path-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcmath","download_url":"https://codeload.github.com/mcmath/relative-path-map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241452303,"owners_count":19965018,"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-11-14T17:36:10.024Z","updated_at":"2026-05-29T21:31:33.673Z","avatar_url":"https://github.com/mcmath.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# relative-path-map\n\n[![Version][version-badge]][npm]\n[![License][license-badge]][license]\n[![Build][build-badge]][travis]\n[![Coverage][coverage-badge]][coveralls]\n[![Dependencies][dependencies-badge]][gemnasium]\n\nResolves a map of paths where some paths are relative to others in the same\nobject. Useful for describing directory structures and for project\nconfiguration.\n\n## Install\n\nInstall via [npm][npm]:\n\n```sh\nnpm install --save-dev relative-path-map\n```\n\n## Examples\n\n#### Simple example\n\n```js\nvar relativePathMap = require('relative-path-map');\n\nrelativePathMap({\n  root: 'root/path',\n  sub: '[root]/sub' // =\u003e 'root/path/sub'\n});\n```\n\n#### Sub-object with relative paths\n\n```js\nrelativePathMap({\n  root: 'root/path',\n  obj: {\n    sub: '[root]/sub', // =\u003e 'root/path/sub'\n    file: '[sub]/file.js' // =\u003e 'root/path/sub/file.js'\n  }\n});\n```\n\n#### Array with relative paths\n\n```js\nrelativePathMap({\n  root: 'root/path',\n  arr: [\n    '[root]/sub', // =\u003e 'root/path/sub'\n    '[0]/file.js' // =\u003e 'root/path/sub/file.js'\n  ]\n});\n```\n\n#### Placeholder with sub-property\n\n```js\nrelativePathMap({\n  obj: {\n    sub: 'some/path',\n  },\n  dot: '[obj.sub]/dot-notation.js' // =\u003e // 'some/path/dot-notation.js'\n});\n```\n\n## API\n\n### `relativePathMap(map)`\n\n### Params\n\n##### map `object`\n\nAn object containing strings representing paths. Paths beginning with a\nplaceholder `[\u003cprop\u003e]` are relative to some other path in the same object, where\n`\u003cprop\u003e` is a property name, e.g. `[root]`, or a sub-property name, e.g\n`[root.src]`.\n\n### Returns\n\nType: `object`\n\nReturns an object whose relative paths have been resolved.\n\n## License\n\nCopyright \u0026copy; 2016 Akim McMath. Licensed under the [MIT License][license].\n\n[version-badge]: https://img.shields.io/npm/v/relative-path-map.svg?style=flat-square\n[license-badge]: https://img.shields.io/npm/l/relative-path-map.svg?style=flat-square\n[build-badge]: https://img.shields.io/travis/akim-mcmath/relative-path-map/master.svg?style=flat-square\n[coverage-badge]: https://img.shields.io/coveralls/akim-mcmath/relative-path-map/master.svg?style=flat-square\u0026service=github\n[dependencies-badge]: https://img.shields.io/gemnasium/akim-mcmath/relative-path-map.svg?style=flat-square\n\n[npm]: https://www.npmjs.com/package/relative-path-map\n[license]: LICENSE.txt\n[travis]: https://travis-ci.org/akim-mcmath/relative-path-map\n[coveralls]: https://coveralls.io/github/akim-mcmath/relative-path-map?branch=master\n[gemnasium]: https://gemnasium.com/akim-mcmath/relative-path-map\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcmath%2Frelative-path-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcmath%2Frelative-path-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcmath%2Frelative-path-map/lists"}