{"id":19621368,"url":"https://github.com/commenthol/url-safe-base64","last_synced_at":"2025-04-28T03:32:18.158Z","repository":{"id":22115975,"uuid":"88901562","full_name":"commenthol/url-safe-base64","owner":"commenthol","description":"url safe base64 en- and decoding","archived":false,"fork":false,"pushed_at":"2023-08-19T20:29:58.000Z","size":19,"stargazers_count":27,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T20:06:36.156Z","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":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commenthol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-20T19:09:30.000Z","updated_at":"2024-11-24T14:26:10.000Z","dependencies_parsed_at":"2024-06-18T17:53:32.511Z","dependency_job_id":null,"html_url":"https://github.com/commenthol/url-safe-base64","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"4ad74e2eee006f12fd621770c9af91d900831396"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Furl-safe-base64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Furl-safe-base64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Furl-safe-base64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Furl-safe-base64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/url-safe-base64/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246265,"owners_count":21558762,"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-11T11:22:40.998Z","updated_at":"2025-04-28T03:32:17.550Z","avatar_url":"https://github.com/commenthol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# url-safe-base64\n\n\u003e url safe base64 en- and decoding\n\n[![NPM version](https://badge.fury.io/js/url-safe-base64.svg)](https://www.npmjs.com/package/url-safe-base64/)\n\n## TOC\n\n* [Example](#example)\n* [API](#api)\n  * [`encode(base64)`](#encodebase64)\n  * [`decode(safe)`](#decodesafe)\n  * [`trim(string)`](#trimstr)\n  * [`isBase64(string)`](#isbase64string)\n  * [`isUrlSafeBase64(string)`](#isurlsafebase64string)\n* [Installation](#installation)\n* [Tests](#tests)\n* [LICENSE](#license)\n\n## Example\n\n```js\nimport {\n  encode, decode, trim,\n  isBase64, isUrlSafeBase64\n} from 'url-safe-base64'\nconst safe = encode('A/B+C==')\n// \u003e 'A-B_C=='\ntrim(safe)\n// \u003e 'A-B_C'\nconst base64 = decode(safe)\n// \u003e 'A/B+C=='\nisBase64(base64)\n// \u003e true\nisBase64(safe)\n// \u003e false\nisUrlSafeBase64(base64)\n// \u003e false\nisUrlSafeBase64(safe)\n// \u003e true\n```\n\n## API\n\n### `encode(base64)`\n\nencode base64 string url safe\n\n**Parameters**\n\n| parameter | type   | description             |\n| --------- | ------ | ----------------------- |\n| `base64`  | String | base64 encoded string |\n\n**Returns** `String`, url-safe-base64 encoded\n\n\n### `decode(safe)`\n\ndecode url-safe-base64 string to base64\n\n**Parameters**\n\n| parameter | type   | description              |\n| --------- | ------ | ------------------------ |\n| `safe`    | String | - url-safe-base64 string |\n\n**Returns** `String`, base64 encoded\n\n\n### `trim(string)`\n\ntrim padding - `window.atob` might handle trimmed strings, e.g. in Chrome@57, Firefox@52\n\n**Parameters**\n\n| parameter | type   | description                        |\n| --------- | ------ | ---------------------------------- |\n| `string`  | String | - base64 or url-safe-base64 string |\n\n**Returns** `String`, string with padding chars removed\n\n\n### `isBase64(string)`\n\nchecks if `string` is base64 encoded\n\n**Returns** `Boolean`, true if base64 encoded\n\n\n### `isUrlSafeBase64(string)`\n\nchecks if `string` is url-safe-base64 encoded\n\n**Returns** `Boolean`, true if url-safe-base64 encoded\n\n## Installation\n\n```sh\n$ npm install --save url-safe-base64\n```\n\n## Tests\n\n```sh\n$ npm test\n```\n\n## LICENSE\n\nUNLICENSE \u003chttps://unlicense.org/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Furl-safe-base64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Furl-safe-base64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Furl-safe-base64/lists"}