{"id":18994082,"url":"https://github.com/confact/sourcemap","last_synced_at":"2026-04-15T14:30:14.323Z","repository":{"id":141115021,"uuid":"524716375","full_name":"confact/sourcemap","owner":"confact","description":"A sourcemap parser in crystal using vlq decoding","archived":false,"fork":false,"pushed_at":"2023-09-11T06:45:18.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T14:54:22.811Z","etag":null,"topics":["crystal","sourcemap","sourcemaps"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/confact.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-08-14T15:59:05.000Z","updated_at":"2022-08-17T15:59:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"773b68a3-29aa-49f6-b564-eef994c083a4","html_url":"https://github.com/confact/sourcemap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confact%2Fsourcemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confact%2Fsourcemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confact%2Fsourcemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/confact%2Fsourcemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/confact","download_url":"https://codeload.github.com/confact/sourcemap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240008540,"owners_count":19733351,"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":["crystal","sourcemap","sourcemaps"],"created_at":"2024-11-08T17:24:06.430Z","updated_at":"2026-04-15T14:30:14.270Z","avatar_url":"https://github.com/confact.png","language":"Crystal","readme":"# Sourcemap Parser\n\nA sourcemap parser in crystal, using vlq encoding.\n\nThis repo use changed code from the repo [ConradIrwin/ruby-source_map](https://github.com/ConradIrwin/ruby-source_map). Thanks Conrad Irwin!\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     sourcemap:\n       github: confact/sourcemap\n   ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\nrequire \"sourcemap\"\n```\n\nGet a sourcemap from a sourcemap file:\n\n```crystal\nSourcemap::Parser.from_file(\"sourcemap.js.map\")\n```\n\nGet a sourcemap from a sourcemap json string:\n\n```crystal\nSourcemap::Parser.from_string(sourcemap_string)\n```\n\nTo get the mappings of the sourcemap:\n\n```crystal\nsourcemap = Sourcemap::Parser.from_file(\"sourcemap.js.map\")\n\nsourcemap.parsed_mappings\n```\n\nIt will return an array of Sourcemap::Mapping. Those mappings can be used to get the original source code and the original line and column.\n\n\nRetrive all mappings for a line and column:\n\n```crystal\nsourcemap = Sourcemap::Parser.from_file(\"sourcemap.js.map\")\n\nmapping = sourcemap.mapping_for(1, 1)\n```\n\nGet mappings for specific source file:\n\n```crystal\nsourcemap = Sourcemap::Parser.from_file(\"sourcemap.js.map\")\n\nsourcemap.mappings_for_source(\"sourcemap.js\")\n```\n\n\n## Development\n\nclone the repo and see the code and test the specs. the specs can be run with `crystal spec`\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/confact/sourcemap/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Håkan](https://github.com/confact) - creator and maintainer\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfact%2Fsourcemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconfact%2Fsourcemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfact%2Fsourcemap/lists"}