{"id":21610487,"url":"https://github.com/d-band/uri-utils","last_synced_at":"2025-07-22T18:35:30.159Z","repository":{"id":57387488,"uuid":"115713679","full_name":"d-band/uri-utils","owner":"d-band","description":"Utility for URI encoding based on RFC 3986.","archived":false,"fork":false,"pushed_at":"2020-06-01T01:00:53.000Z","size":16,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-23T02:49:02.160Z","etag":null,"topics":["encode-path","encodeuri","rfc-3986","uri"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d-band.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-29T10:37:20.000Z","updated_at":"2020-02-04T07:15:35.000Z","dependencies_parsed_at":"2022-09-07T14:51:30.764Z","dependency_job_id":null,"html_url":"https://github.com/d-band/uri-utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d-band/uri-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Furi-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Furi-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Furi-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Furi-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-band","download_url":"https://codeload.github.com/d-band/uri-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-band%2Furi-utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266552738,"owners_count":23947183,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["encode-path","encodeuri","rfc-3986","uri"],"created_at":"2024-11-24T21:08:21.601Z","updated_at":"2025-07-22T18:35:30.128Z","avatar_url":"https://github.com/d-band.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"URI Utilities\n=============\n\n[![NPM version](https://img.shields.io/npm/v/uri-utils.svg)](https://www.npmjs.com/package/uri-utils)\n[![NPM downloads](https://img.shields.io/npm/dm/uri-utils.svg)](https://www.npmjs.com/package/uri-utils)\n[![Build Status](https://travis-ci.org/d-band/uri-utils.svg?branch=master)](https://travis-ci.org/d-band/uri-utils)\n[![Coverage Status](https://coveralls.io/repos/github/d-band/uri-utils/badge.svg?branch=master)](https://coveralls.io/github/d-band/uri-utils?branch=master)\n[![Dependency Status](https://david-dm.org/d-band/uri-utils.svg)](https://david-dm.org/d-band/uri-utils)\n[![Greenkeeper badge](https://badges.greenkeeper.io/d-band/uri-utils.svg)](https://greenkeeper.io/)\n\n\u003e Utility for URI encoding based on RFC 3986.\n\n## Getting Started\n\n### Install\n\n```bash\n$ npm install --save uri-utils\n```\n\n### Usage Example\n\n```javascript\nimport { encode, encodePath } from 'uri-utils';\n\n// or\nimport * as utils from 'uri-utils';\n```\n\n## API Reference\n\n```javascript\nimport {\n  TYPE,\n  encodeScheme,\n  encodeAuthority,\n  encodeUserInfo,\n  encodeHost,\n  encodePort,\n  encodePath,\n  encodePathSegment,\n  encodeQuery,\n  encodeQueryParam,\n  encodeFragment,\n  encode\n} from 'uri-utils';\n```\n\n```\n         foo://example.com:8042/over/there?name=ferret#nose\n         \\_/   \\______________/\\_________/ \\_________/ \\__/\n          |           |            |            |        |\n       scheme     authority       path        query   fragment\n          |   _____________________|__\n         / \\ /                        \\\n         urn:example:animal:ferret:nose\n```\n\n- `TYPE`: encode type for uri\n  ```\n  enum TYPE {\n    SCHEME,\n    AUTHORITY,\n    USER_INFO,\n    HOST_IPV4,\n    HOST_IPV6,\n    PORT,\n    PATH,\n    PATH_SEGMENT,\n    QUERY,\n    QUERY_PARAM,\n    FRAGMENT,\n    URI\n  }\n  ```\n- `encode(source: String, type: TYPE)`: encode with type (type default `TYPE.URI` like `encodeURIComponent`)\n- `encodeScheme(str: String)`: encode scheme\n- `encodeAuthority(str: String)`: encode authority\n- `encodeUserInfo(str: String)`: encode user info\n- `encodeHost(str: String)`: encode host\n- `encodePort(str: String)`: encode port\n- `encodePath(str: String)`: encode path\n- `encodePathSegment(str: String)`: encode path segment\n- `encodeQuery(str: String)`: encode query \n- `encodeQueryParam(str: String)`: encode query param\n- `encodeFragment(str: String)`: encode fragment\n\n\n## Benchmark\n\n```\nnode version: v4.8.7\nuri-utils          x 150,915 ops/sec ±1.08% (89 runs sampled)\nencodeURIComponent x 112,777 ops/sec ±1.29% (73 runs sampled)\nFastest is uri-utils\n\nnode version: v6.12.3\nuri-utils          x 80,632 ops/sec ±0.55% (75 runs sampled)\nencodeURIComponent x 73,166 ops/sec ±1.32% (77 runs sampled)\nFastest is uri-utils\n\nnode version: v8.9.4\nuri-utils          x 155,020 ops/sec ±5.58% (75 runs sampled)\nencodeURIComponent x 612,347 ops/sec ±4.05% (83 runs sampled)\nFastest is encodeURIComponent\n```\n\n## Report a issue\n\n* [All issues](https://github.com/d-band/uri-utils/issues)\n* [New issue](https://github.com/d-band/uri-utils/issues/new)\n\n## License\n\nuri-utils is available under the terms of the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-band%2Furi-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-band%2Furi-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-band%2Furi-utils/lists"}