{"_id":"@loxjs/url-join","_rev":"2-fcc621366706f71b830e47f235c657b8","name":"@loxjs/url-join","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@loxjs/url-join","version":"1.0.0","main":"index.js","license":"MIT","author":{"name":"Zen Li"},"repository":{"type":"git","url":"git+https://github.com/loxjs/mono.git","directory":"packages/url-join"},"homepage":"https://github.com/loxjs/mono/tree/main/packages/url-join#readme","bugs":{"url":"https://github.com/loxjs/mono/issues"},"_id":"@loxjs/url-join@1.0.0","gitHead":"9ae0b247f6d3de6e1b65d6761c1ea7fbb67c42cd","description":"`@loxjs/url-join` is a Node.js utility module that allows for the concatenation of URL segments into a single, normalized URL. It is a fork of the original [url-join](https://github.com/jfromaniello/url-join) module, modified to support `require` in addit","_nodeVersion":"21.6.2","_npmVersion":"10.2.4","dist":{"integrity":"sha512-sE5Zc1igh8EMbJqBtUG4WlaDrEDTQxCJMH6BCyd7J6PzBDuL3bUlGUWpt0te3w5y3HXlvhdtELZlkHzIFgujQA==","shasum":"6007686cc5965e15c3a77b5de90ab02cfc3efeef","tarball":"https://registry.npmjs.org/@loxjs/url-join/-/url-join-1.0.0.tgz","fileCount":3,"unpackedSize":5394,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCScHaC3dx2im5azr0dKEM2cNLotVg07hgYEiSuOVMkGgIhAODDGDeGZU6rs4k3ZQJNHgEQXnm7SZbftiNkmAtKRJgM"}]},"_npmUser":{"name":"zencode","email":"zenli@outlook.com"},"directories":{},"maintainers":[{"name":"galendai","email":"galen.dai@gmail.com"},{"name":"zencode","email":"zenli@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-join_1.0.0_1709750886095_0.32198596082503284"},"_hasShrinkwrap":false},"1.0.1":{"name":"@loxjs/url-join","version":"1.0.1","main":"index.js","description":"Join urls and normalize as in path.join.","keywords":["url","join","path","link"],"license":"MIT","author":{"name":"Zen Li"},"repository":{"type":"git","url":"git+https://github.com/loxjs/mono.git","directory":"packages/url-join"},"homepage":"https://github.com/loxjs/mono/tree/main/packages/url-join#readme","bugs":{"url":"https://github.com/loxjs/mono/issues"},"_id":"@loxjs/url-join@1.0.1","gitHead":"64d51c86ce2bfcc6bb9140de820bb0703445030d","_nodeVersion":"21.6.2","_npmVersion":"10.2.4","dist":{"integrity":"sha512-IBzaYDayBJIho3s0kmJshYc25U4AnYPwSPr5Dou3Yg15CubNhKVbfUgKFfqI+Cb9rxQZ8UzJIwGAvuk5IRZ06w==","shasum":"d84c43a104d494184743bc5d7dfb85d97194b5ab","tarball":"https://registry.npmjs.org/@loxjs/url-join/-/url-join-1.0.1.tgz","fileCount":3,"unpackedSize":5544,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+gVUfB3VI+E0/9W4ueSuuw1vonlFnGS8Hi2qamebvJgIgSuBFbnUR4tzQCcEIiNYNIyvIm8KntrjIa5hNMK2JNd8="}]},"_npmUser":{"name":"zencode","email":"zenli@outlook.com"},"directories":{},"maintainers":[{"name":"galendai","email":"galen.dai@gmail.com"},{"name":"zencode","email":"zenli@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-join_1.0.1_1709751230811_0.8469824968937809"},"_hasShrinkwrap":false},"1.0.2":{"name":"@loxjs/url-join","version":"1.0.2","main":"index.js","description":"Join urls and normalize as in path.join.","keywords":["url","join","path","link"],"license":"MIT","author":{"name":"Zen Li"},"repository":{"type":"git","url":"git+https://github.com/loxjs/mono.git","directory":"packages/url-join"},"homepage":"https://github.com/loxjs/mono/tree/main/packages/url-join#readme","bugs":{"url":"https://github.com/loxjs/mono/issues"},"_id":"@loxjs/url-join@1.0.2","gitHead":"2e02b48a9e496c748e280a3cbce4b00a11e32751","_nodeVersion":"21.6.2","_npmVersion":"10.2.4","dist":{"integrity":"sha512-BqzK8+iHqxUbPRZV6NBum63CJzE0G6vGG3o+4dqeIzbywdoTg+xHJbksYDkk1P1w3Gj64U20Rgp44HHciLbRzg==","shasum":"78f9082ebe2f0e75fe97aa5752586015be5a4d53","tarball":"https://registry.npmjs.org/@loxjs/url-join/-/url-join-1.0.2.tgz","fileCount":3,"unpackedSize":5452,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3SLvC2OfYBdo4bQfa1uj2ffjG2uTex/sbTOZ8bi+y2QIhAMsgINZLUUJfP/vUtPjDMjYfHcL7iguzb9uRXDVY5xEl"}]},"_npmUser":{"name":"zencode","email":"zenli@outlook.com"},"directories":{},"maintainers":[{"name":"galendai","email":"galen.dai@gmail.com"},{"name":"zencode","email":"zenli@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-join_1.0.2_1709752175124_0.49257414891560636"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-06T18:48:05.953Z","1.0.0":"2024-03-06T18:48:06.226Z","modified":"2024-03-06T19:09:35.766Z","1.0.1":"2024-03-06T18:53:50.978Z","1.0.2":"2024-03-06T19:09:35.280Z"},"maintainers":[{"name":"galendai","email":"galen.dai@gmail.com"},{"name":"zencode","email":"zenli@outlook.com"}],"description":"Join urls and normalize as in path.join.","homepage":"https://github.com/loxjs/mono/tree/main/packages/url-join#readme","repository":{"type":"git","url":"git+https://github.com/loxjs/mono.git","directory":"packages/url-join"},"author":{"name":"Zen Li"},"bugs":{"url":"https://github.com/loxjs/mono/issues"},"license":"MIT","readme":"# @loxjs/url-join\n\n`@loxjs/url-join` is a Node.js utility module that allows for the concatenation of URL segments into a single, normalized URL. It is a fork of the original [url-join](https://github.com/jfromaniello/url-join) module, modified to support `require` in addition to `import` for module inclusion, making it more accessible for a wider range of Node.js projects.\n\n## Installation\n\nTo install the module, use npm or yarn as follows:\n\n```sh\nnpm install @loxjs/url-join\n```\n\nor\n\n```sh\nyarn add @loxjs/url-join\n```\n\n## Usage\n\nTo use this module in your project, simply require it and then call the `urlJoin` function with the URL segments you want to join together:\n\n```\nconst urlJoin = require('@loxjs/url-join');\n\nconst myUrl = urlJoin('http://example.com', 'path', 'to', 'resource');\nconsole.log(myUrl);\n// Output: http://example.com/path/to/resource\n```\n\n## Examples\n\nJoining URL segments with query parameters:\n\n```\nconst myUrl = urlJoin('http://example.com', 'search', '?query=node');\n// Output: http://example.com/search?query=node\n```\n\nHandling trailing slashes:\n\n```\nconst myUrl = urlJoin('http://example.com/', '/about/');\n// Output: http://example.com/about/\n```\n\nSupport for file protocol:\n\n```\nconst myUrl = urlJoin('file:///', 'usr', 'local', 'bin');\n// Output: file:///usr/local/bin\n```\n\n## Acknowledgements\n\nWe would like to express our gratitude to the author and contributors of the original [url-join](https://github.com/jfromaniello/url-join) module. `@loxjs/url-join` is built upon the solid foundation they provided, and this modification would not have been possible without their groundwork.\n\n## Features\n\n - Normalizes URL paths by removing redundant slashes.\n - Correctly handles protocols and slashes specific to file URLs.\n - Supports both `require` and `import` statements for module inclusion.\n - Manages trailing slashes and query parameters in a URL.\n - Throws informative errors for non-string URL segments.\n\n## API\n\n### urlJoin(...args)\n\nJoins all given URL segments and normalizes the result.\n\nArguments:\n\n - `...args` (String[]): An array of strings representing each segment of the URL.\n\nReturns:\n\n - String: A string of the normalized URL.\n\n\n## Contributing\n\nContributions to `@loxjs/url-join` are welcome! Please ensure that your contributions adhere to the following guidelines:\n\n - Write clear, readable, and maintainable code.\n - Follow existing coding styles and practices.\n - Write meaningful commit messages.\n - Update the documentation accordingly.\n\nFor more detailed information, please read the [contributing guide](https://github.com/loxjs/mono/CONTRIBUTING.md).\n\nEnjoy using `@loxjs/url-join`!","readmeFilename":"README.md","keywords":["url","join","path","link"]}