{"id":13468425,"url":"https://github.com/Sage/jsurl","last_synced_at":"2025-03-26T05:31:04.844Z","repository":{"id":1785099,"uuid":"2708939","full_name":"Sage/jsurl","owner":"Sage","description":"URL-friendly JSON","archived":false,"fork":false,"pushed_at":"2023-04-15T08:29:04.000Z","size":24,"stargazers_count":390,"open_issues_count":8,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-18T14:50:21.955Z","etag":null,"topics":[],"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/Sage.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,"governance":null}},"created_at":"2011-11-04T12:19:27.000Z","updated_at":"2025-03-14T16:10:40.000Z","dependencies_parsed_at":"2023-07-05T19:02:51.788Z","dependency_job_id":null,"html_url":"https://github.com/Sage/jsurl","commit_stats":{"total_commits":30,"total_committers":6,"mean_commits":5.0,"dds":"0.19999999999999996","last_synced_commit":"b1e244d145bb440f776d8fec673cc743c42c5cbc"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fjsurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fjsurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fjsurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fjsurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sage","download_url":"https://codeload.github.com/Sage/jsurl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245267542,"owners_count":20587459,"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-07-31T15:01:10.579Z","updated_at":"2025-03-26T05:31:04.823Z","avatar_url":"https://github.com/Sage.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## JSURL\n\nJSURL is an alternative to JSON + URL encoding (or JSON + base64 encoding). \nIt makes it handy to pass complex values via URL query parameters.\n\nJSURL has been designed to be:\n\n* Compact: its output is much more compact than JSON + URL encoding (except in pathological cases). \n  It is even often slightly more compact than regular JSON!\n* Readable: its output is much more readable than JSON + URL encoding.\n* Foolproof: its output only contains characters that are unaffected by URL encoding/decoding. \n  There is no risk of missing a URL encoding/decoding pass, or of messing up a JSURL string by applying \n  an extra URL encoding or decoding pass.\n* Easy to generate and parse\n\n## Syntax\n\nThink of it as JSON with the following changes:\n\n* Curly braces (`{` and `}`) replaced by parentheses (`(` and `)`)\n* Square brackets (`[` and `]`) replaced by `(~` and `)`\n* Property names unquoted (but escaped -- see below).\n* String values prefixed by a single quote (`'`) and escaped\n* All other JSON punctuation (colon `:` and comma `,`) replaced by tildes (`~`)\n* An extra tilde (`~`) at the very beginning.\n\nProperty names and string values are escaped as follows:\n\n* Letters, digits, underscore (`_`), hyphen (`-`) and dot (`.`) are preserved.\n* Dollar sign (`$`) is replaced by exclamation mark (`!`)\n* Other characters with UNICODE value \u003c= `0xff` are encoded as `*XX`\n* Characters with UNICODE value \u003e `0xff` are encoded as `**XXXX`\n\n## Examples\n\nJSON:\n\n``` json\n{\"name\":\"John Doe\",\"age\":42,\"children\":[\"Mary\",\"Bill\"]}\n```\n\nJSON + URL encoding:\n\n```\n%7B%22name%22%3A%22John%20Doe%22%2C%22age%22%3A42%2C%22children%22%3A%5B%22Mary%22%2C%22Bill%22%5D%7D\n```\n\nJSURL:\n\n``` jsurl\n~(name~'John*20Doe~age~42~children~(~'Mary~'Bill))\n```\n\n## API\n\n``` javascript\nvar JSURL = require(\"jsurl\");\n\nstr = JSURL.stringify(obj);\nobj = JSURL.parse(str);\n\n// return def instead of throwing on error\nobj = JSURL.tryParse(str[, def]);\n```\n\n# Installation\n\nThe easiest way to install `jsurl` is with NPM:\n\n```sh\nnpm install jsurl\n```\n\n## License\n\nThis work is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSage%2Fjsurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSage%2Fjsurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSage%2Fjsurl/lists"}