{"id":13671152,"url":"https://github.com/Rich-Harris/vlq","last_synced_at":"2025-04-27T14:33:07.196Z","repository":{"id":21252367,"uuid":"24567888","full_name":"Rich-Harris/vlq","owner":"Rich-Harris","description":"Generate, and decode, base64 VLQ mappings for sourcemaps and other uses","archived":false,"fork":false,"pushed_at":"2024-09-27T06:58:16.000Z","size":303,"stargazers_count":212,"open_issues_count":3,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-27T04:33:12.495Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rich-Harris.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2014-09-28T19:07:31.000Z","updated_at":"2025-04-25T09:42:59.000Z","dependencies_parsed_at":"2024-06-18T12:30:39.853Z","dependency_job_id":"115b2a13-4943-435f-ad79-8f0d4cda4e86","html_url":"https://github.com/Rich-Harris/vlq","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":"0.19999999999999996","last_synced_commit":"e3009f5757abeb0b5b6233045f3bbdaf86435d08"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rich-Harris%2Fvlq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rich-Harris%2Fvlq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rich-Harris%2Fvlq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rich-Harris%2Fvlq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rich-Harris","download_url":"https://codeload.github.com/Rich-Harris/vlq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251154323,"owners_count":21544477,"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-08-02T09:01:00.888Z","updated_at":"2025-04-27T14:33:06.888Z","avatar_url":"https://github.com/Rich-Harris.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# vlq.js\n\nConvert integers to a Base64-encoded VLQ string, and vice versa. No dependencies, works in node.js or browsers, supports AMD.\n\n\n## Why would you want to do that?\n\nSourcemaps are the most likely use case. Mappings from original source to generated content are encoded as a sequence of VLQ strings.\n\n\n## What is a VLQ string?\n\nA [variable-length quantity](http://en.wikipedia.org/wiki/Variable-length_quantity) is a compact way of encoding large integers in text (i.e. in situations where you can't transmit raw binary data). An integer represented as digits will always take up more space than the equivalent VLQ representation:\n\n| Integer             | VLQ        |\n| :------------------ | :--------- |\n| 0                   | A          |\n| 1                   | C          |\n| -1                  | D          |\n| 123                 | 2H         |\n| 123456789           | qxmvrH     |\n\n\n## Installation\n\n```bash\nnpm install vlq\n```\n\n\n## Usage\n\n### Encoding\n\n`vlq.encode` accepts an integer, or an array of integers, and returns a string:\n\n```js\nvlq.encode(123); // '2H';\nvlq.encode([123, 456, 789]); // '2HwcqxB'\n```\n\n### Decoding\n\n`vlq.decode` accepts a string and always returns an array:\n\n```js\nvlq.decode('2H'); // [123]\nvlq.decode('2HwcqxB'); // [123, 456, 789]\n```\n\n\n## Limitations\n\nSince JavaScript bitwise operators work on 32 bit integers, the maximum value this library can handle is 2^30 - 1, or 1073741823.\n\n\n## Using vlq.js with sourcemaps\n\n[See here for an example of using vlq.js with sourcemaps.](https://github.com/Rich-Harris/vlq/tree/master/sourcemaps)\n\n\n## Credits\n\nAdapted from [murzwin.com/base64vlq.html](http://murzwin.com/base64vlq.html) by Alexander Pavlov.\n\n\n## License\n\n[MIT](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRich-Harris%2Fvlq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRich-Harris%2Fvlq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRich-Harris%2Fvlq/lists"}