{"_id":"relative-import-path","_rev":"3-bab0643f0f0db99a70172619782a7c9c","name":"relative-import-path","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"relative-import-path","version":"1.0.0","keywords":["node_modules","path","relative","require","resolve","shorten"],"author":{"name":"Dylan Piercey","email":"dpiercey@ebay.com"},"license":"MIT","_id":"relative-import-path@1.0.0","maintainers":[{"name":"dylanpiercey","email":"pierceydylan@gmail.com"}],"homepage":"https://github.com/marko-js/relative-import-path","bugs":{"url":"https://github.com/marko-js/relative-import-path/issues"},"dist":{"shasum":"8f69920f0f278331b2984f8c393232606f909a47","tarball":"https://registry.npmjs.org/relative-import-path/-/relative-import-path-1.0.0.tgz","fileCount":6,"integrity":"sha512-ZvbtoduKQmD4PZeJPfH6Ql21qUWhaMxiHkIsH+FUnZqKDwNIXBtGg5zRZyHWomiGYk8n5+KMBPK7Mi4D0XWfNg==","signatures":[{"sig":"MEUCICVKR0WYrz59WEF5NhQn+hGsyvKNwdfMTvLkHsvu5i7nAiEArfIoMSVv5yj8NJXM/xSKDZ6EyfvsqtMeObxXQ6MKsOc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiK6TgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpahA//Yj2uoDz68TRAagjqbr7TLnWtytqLgJ56Q79B03RQzoPFO+mx\r\n2b/a8okA7tleww3qIHeTjp3qx4mJg6i+fe7/m/i4udUFwFI1XPkUecyL6L/J\r\nBN9PE5yif1FEqT3gL3653plCqN5gT7HdSSoReYpRwTQkMU0z1cQNLLsDMgiT\r\n3rMjX2dJgLsso765GRzoaCmFyAsQj81usC3OK9ra8hi0e/RtvZYMmqKGIbAB\r\n5WOdlDvnbroYuciqhb3Udim3c8fTZA0T+dW7FudWcHwvpmxWzy1qJbzmkCLM\r\nQiO1FxyqSQTZkhdPUJk+WQfX645QCDHAfyVSU5XliIKhW3HIbOTjQW6Ea1NM\r\n0lOfuR0e5x5r+IuhPh/R9rWnD6FV2bgvgXXTFmRvx7lql9Ru6QewbPBGYWI+\r\nx279fkz5APaeJ1uFvdjW5D2y4da7PWIZiHALvD+com7lMOY5bG5m9wi1ssic\r\n/jS6VXjiVVNllZ5M88zLS1Si23Xq0NOryzy/N6uqyv4awXn1/p2xaPgvdU/W\r\nvwmsqioh1QRu1f2jGmp1zinRGEaIFPMfyKBONiONN5fATbEBIvpynBwTlPx+\r\nxnOi0/f0kDL3OnYpr7xzpDxyuUxCaD4BL2581aJ5Rjep2youNBVeRD/hNHRY\r\nUZ93SjOnKgLWAIEy+tXNy+5lWx+IPCL8rmg=\r\n=Mcni\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","types":"dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":"./dist/index.mjs","default":"./dist/index.js"}},"gitHead":"7ae0f503f67db50a3177ee443ae95e10cc92d760","scripts":{"lint":"tsc -b && npm run lint:eslint && npm run lint:prettier -- -l && fixpack","test":"npm run mocha -- --watch","build":"tsc -b && node -r esbuild-register build","mocha":"cross-env NODE_ENV=test mocha \"./src/**/__tests__/*.test.ts\"","format":"npm run lint:eslint -- --fix && npm run lint:prettier -- --write && (fixpack || true)","report":"open ./coverage/lcov-report/index.html","ci:test":"nyc npm run mocha -- --forbid-pending --forbid-only","prepare":"husky install","release":"semantic-release","lint:eslint":"eslint -f visualstudio .","test:update":"npm run mocha -- --update","test:inspect":"npm test -- --inspect","lint:prettier":"prettier \"./**/*{.ts,.js,.json,.md,.yml,rc}\"","prepublishOnly":"npm run build"},"_npmUser":{"name":"dylanpiercey","email":"pierceydylan@gmail.com"},"repository":{"url":"git+https://github.com/marko-js/relative-import-path.git","type":"git"},"_npmVersion":"8.5.4","description":"path.relative for generating short require'able paths.","directories":{},"_nodeVersion":"16.14.0","_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","husky":"^7.0.4","mocha":"^9.2.1","eslint":"^8.10.0","esbuild":"^0.14.25","fixpack":"^4.0.0","prettier":"^2.5.1","cross-env":"^7.0.3","fast-glob":"^3.2.11","mocha-snap":"^4.3.0","typescript":"^4.6.2","@types/node":"^17.0.21","lint-staged":"^12.3.5","@types/mocha":"^9.1.0","@commitlint/cli":"^16.2.1","esbuild-register":"^3.3.2","semantic-release":"^19.0.2","eslint-config-prettier":"^8.5.0","@typescript-eslint/parser":"^5.14.0","@commitlint/config-conventional":"^16.2.1","@typescript-eslint/eslint-plugin":"^5.14.0"},"_npmOperationalInternal":{"tmp":"tmp/relative-import-path_1.0.0_1647027424667_0.6167400134258907","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"relative-import-path","description":"path.relative for generating short require'able paths.","version":"1.0.1","author":{"name":"Dylan Piercey","email":"dpiercey@ebay.com"},"bugs":{"url":"https://github.com/marko-js/relative-import-path/issues"},"devDependencies":{"@commitlint/cli":"^16.2.1","@commitlint/config-conventional":"^16.2.1","@types/mocha":"^10.0.10","@types/node":"^17.0.21","@typescript-eslint/eslint-plugin":"^5.14.0","@typescript-eslint/parser":"^5.14.0","cross-env":"^7.0.3","esbuild":"^0.14.25","esbuild-register":"^3.3.2","eslint":"^8.10.0","eslint-config-prettier":"^8.5.0","fast-glob":"^3.2.11","fixpack":"^4.0.0","husky":"^7.0.4","lint-staged":"^12.3.5","mocha":"^11.7.6","mocha-snap":"^4.3.0","nyc":"^17.1.0","prettier":"^2.5.1","semantic-release":"^25.0.7","typescript":"^4.6.2"},"exports":{".":{"import":"./dist/index.mjs","default":"./dist/index.js"}},"homepage":"https://github.com/marko-js/relative-import-path","keywords":["node_modules","path","relative","require","resolve","shorten"],"license":"MIT","main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/marko-js/relative-import-path.git"},"scripts":{"build":"tsc -b && node -r esbuild-register build","ci:test":"nyc npm run mocha -- --forbid-pending --forbid-only","format":"npm run lint:eslint -- --fix && npm run lint:prettier -- --write && (fixpack || true)","lint":"tsc -b && npm run lint:eslint && npm run lint:prettier -- -l && fixpack","lint:eslint":"eslint -f visualstudio .","lint:prettier":"prettier \"./**/*{.ts,.js,.json,.md,.yml,rc}\"","mocha":"cross-env NODE_ENV=test mocha \"./src/**/__tests__/*.test.ts\"","prepare":"husky install","prepublishOnly":"npm run build","release":"semantic-release","report":"open ./coverage/lcov-report/index.html","test":"npm run mocha -- --watch","test:inspect":"npm test -- --inspect","test:update":"npm run mocha -- --update"},"types":"dist/index.d.ts","gitHead":"981d8f4300cc2967bab6a4072e2f66a1dd302e6a","_id":"relative-import-path@1.0.1","_nodeVersion":"26.5.0","_npmVersion":"11.18.0","dist":{"integrity":"sha512-mLABwLdOB694B3BW3bNlLOJsWCDhFRBn4BW+gkhILZXJFaymkQWDZom+3qOGYFpbN9K8eeQx8lsy2N+SX/qncQ==","shasum":"8ecdfc3d5f74f8311f966a4d6b4b7b35c29c2fbb","tarball":"https://registry.npmjs.org/relative-import-path/-/relative-import-path-1.0.1.tgz","fileCount":6,"unpackedSize":11380,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/relative-import-path@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDfiC6sBa9zt5UFk9241DqeiGr+SIXvfexw3fFifgQ0pAIgbJuWraOA5Ad9zFz/XTQht/ro1nj5dIVA4sNa6E+bMB8="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7a53436f-2650-455f-a097-8ca470fb50f1"}},"directories":{},"maintainers":[{"name":"dylanpiercey","email":"pierceydylan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/relative-import-path_1.0.1_1783978351804_0.5693959227072063"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-11T19:37:04.666Z","modified":"2026-07-13T21:32:32.345Z","1.0.0":"2022-03-11T19:37:04.833Z","1.0.1":"2026-07-13T21:32:32.017Z"},"bugs":{"url":"https://github.com/marko-js/relative-import-path/issues"},"author":{"name":"Dylan Piercey","email":"dpiercey@ebay.com"},"license":"MIT","homepage":"https://github.com/marko-js/relative-import-path","keywords":["node_modules","path","relative","require","resolve","shorten"],"repository":{"type":"git","url":"git+https://github.com/marko-js/relative-import-path.git"},"description":"path.relative for generating short require'able paths.","maintainers":[{"name":"dylanpiercey","email":"pierceydylan@gmail.com"}],"readme":"<h1 align=\"center\">\n  <!-- Logo -->\n  <br/>\n  relative-import-path\n\t<br/>\n\n  <!-- Format -->\n  <a href=\"https://github.com/prettier/prettier\">\n    <img src=\"https://img.shields.io/badge/styled_with-prettier-ff69b4.svg\" alt=\"Styled with prettier\"/>\n  </a>\n  <!-- CI -->\n  <a href=\"https://github.com/marko-js/relative-import-path/actions/workflows/ci.yml\">\n    <img src=\"https://github.com/marko-js/relative-import-path/actions/workflows/ci.yml/badge.svg\" alt=\"Build status\"/>\n  </a>\n  <!-- Coverage -->\n  <a href=\"https://codecov.io/gh/marko-js/relative-import-path\">\n    <img src=\"https://codecov.io/gh/marko-js/relative-import-path/branch/main/graph/badge.svg?token=lKuTHVY3Ks\" alt=\"Code Coverage\"/>\n  </a>\n  <!-- NPM Version -->\n  <a href=\"https://npmjs.org/package/relative-import-path\">\n    <img src=\"https://img.shields.io/npm/v/relative-import-path.svg\" alt=\"NPM version\"/>\n  </a>\n  <!-- Downloads -->\n  <a href=\"https://npmjs.org/package/relative-import-path\">\n    <img src=\"https://img.shields.io/npm/dm/relative-import-path.svg\" alt=\"Downloads\"/>\n  </a>\n</h1>\n\nLike path.relative, but for generating short require'able paths.\n\n- Removes unnecessary `node_modules` from resolved relative paths.\n- Keeps directories which cannot be a package name (eg pnpm's `.pnpm` virtual store)\n  as a relative path, since they hold no importable module.\n- Automatically converts windows style paths to POSIX.\n\n# Installation\n\n```console\nnpm install relative-import-path\n```\n\n# API\n\n```ts\n/**\n * Given two absolute file paths, resolves a short require'able relative path.\n */\nfunction resolveRelativePath(from: string, to: string): string;\n```\n\n# Examples\n\n```javascript\nimport { relativeImportPath } from \"relative-import-path\";\n\nrelativeImportPath(\"/a/b\", \"/c/d\"); // /c/d\nrelativeImportPath(\"/a/a\", \"/a/b\"); // ./b\nrelativeImportPath(\"/a/a/a\", \"/a/b/a\"); // ../b/a\nrelativeImportPath(\"/a/node_modules/a/a\", \"/a/node_modules/b/a\"); // b/a\nrelativeImportPath(\"/a/node_modules/a/a\", \"/a/node_modules/a/b\"); // ./b\nrelativeImportPath(\"/a/a\", \"/node_modules/b\"); // b\nrelativeImportPath(\"/a/a\", \"/a/node_modules/b\"); // b\nrelativeImportPath(\"/a/b/c\", \"/a/node_modules/b\"); // b\nrelativeImportPath(\"/a/a\", \"/b/node_modules/b\"); // /b/node_modules/b\nrelativeImportPath(\"/a/b/c\", \"/b/node_modules/b\"); // /b/node_modules/b\nrelativeImportPath(\"/a/a\", \"/a/b/node_modules/b\"); // ./b/node_modules/b\nrelativeImportPath(\"/a/node_modules/@a/a/a\", \"/a/node_modules/@a/b/a\"); // @a/b/a\nrelativeImportPath(\"/a/node_modules/@a/a/a\", \"/a/node_modules/@a/a/b\"); // ./b\nrelativeImportPath(\"/a/a\", \"/a/node_modules/b/node_modules/c/a\"); // b/node_modules/c/a\nrelativeImportPath(\"/a/a\", \"/a/node_modules/.pnpm/b@1.0.0/node_modules/b/a\"); // ./node_modules/.pnpm/b@1.0.0/node_modules/b/a\n```\n\n# Code of Conduct\n\nThis project adheres to the [eBay Code of Conduct](./.github/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.\n","readmeFilename":"README.md"}