{"id":22710573,"url":"https://github.com/smallhelm/estree-loc","last_synced_at":"2025-03-29T21:42:40.208Z","repository":{"id":80824559,"uuid":"61919064","full_name":"smallhelm/estree-loc","owner":"smallhelm","description":"Convert a string start and end indices to an estree loc objects.","archived":false,"fork":false,"pushed_at":"2016-08-29T14:31:43.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T22:28:07.582Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smallhelm.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":"2016-06-25T00:12:50.000Z","updated_at":"2016-06-25T00:25:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"d6b258b6-2ce6-4998-b256-b0c4f3c1f83f","html_url":"https://github.com/smallhelm/estree-loc","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"9552bb5d8ae075060a3ffcf57245df92a518a58c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallhelm%2Festree-loc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallhelm%2Festree-loc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallhelm%2Festree-loc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallhelm%2Festree-loc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smallhelm","download_url":"https://codeload.github.com/smallhelm/estree-loc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246249226,"owners_count":20747167,"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-12-10T12:10:35.949Z","updated_at":"2025-03-29T21:42:40.186Z","avatar_url":"https://github.com/smallhelm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# estree-loc\n\n[![build status](https://secure.travis-ci.org/smallhelm/estree-loc.svg)](https://travis-ci.org/smallhelm/estree-loc)\n\nConvert a string start and end indices to an estree loc objects.\n\n```js\nvar EStreeLoc = require('estree-loc');\n\nvar src = 'one\\n    two\\nthree  ';\n\nvar toLoc = EStreeLoc(src, 'some-file.js');\n\nvar loc = toLoc(8, 17);\n```\n```js\n{\n  source: 'some-file.js'\n  start: {line: 2, column: 4},\n  end: {line: 3, column: 5}\n}\n```\n\n## API\n### toLoc = EStreeLoc(src[, source])\nConstructs the `toLoc` function. If you give it `source` file path it will add that to each loc.\n\n### loc = toLoc(start, end)\nReturns the `loc` object for at the given start and end indices of the source code.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallhelm%2Festree-loc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmallhelm%2Festree-loc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallhelm%2Festree-loc/lists"}