{"id":17491828,"url":"https://github.com/knightedcodemonkey/reparse","last_synced_at":"2026-01-22T08:33:15.510Z","repository":{"id":242226064,"uuid":"809038052","full_name":"knightedcodemonkey/reparse","owner":"knightedcodemonkey","description":"Multiple SWC parsings with correct spans.","archived":false,"fork":false,"pushed_at":"2024-06-18T03:19:07.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-22T10:27:23.477Z","etag":null,"topics":["ast","commonjs","esmodule","parser","swc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/knightedcodemonkey.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":"2024-06-01T14:06:46.000Z","updated_at":"2024-06-18T03:18:31.000Z","dependencies_parsed_at":"2024-06-01T14:29:56.170Z","dependency_job_id":"7fb8a5b7-2756-484e-b8ea-b1a048f0f1ed","html_url":"https://github.com/knightedcodemonkey/reparse","commit_stats":null,"previous_names":["knightedcodemonkey/reparse"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/knightedcodemonkey/reparse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Freparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Freparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Freparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Freparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knightedcodemonkey","download_url":"https://codeload.github.com/knightedcodemonkey/reparse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Freparse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28659518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ast","commonjs","esmodule","parser","swc"],"created_at":"2024-10-19T08:05:23.423Z","updated_at":"2026-01-22T08:33:15.493Z","avatar_url":"https://github.com/knightedcodemonkey.png","language":"TypeScript","readme":"# [`@knighted/reparse`](https://www.npmjs.com/package/@knighted/reparse)\n\n![CI](https://github.com/knightedcodemonkey/reparse/actions/workflows/ci.yml/badge.svg)\n[![codecov](https://codecov.io/gh/knightedcodemonkey/reparse/graph/badge.svg?token=YCGi65lsmO)](https://codecov.io/gh/knightedcodemonkey/reparse)\n[![NPM version](https://img.shields.io/npm/v/@knighted/reparse.svg)](https://www.npmjs.com/package/@knighted/reparse)\n\nMultiple SWC parsings of the same file with correct spans.\n\nProvides a workaround for [swc/1366](https://github.com/swc-project/swc/issues/1366).\n\n## Requirements\n\n- Node \u003e= 20.11.0\n- `@swc/core` \u003e= 1.5.24 as peer dependency\n\n## Example\n\nThere are four exports `reparse`, `reparseFile`, `reparseSync` and `reparseFileSync`.\n\n```js\nimport { reparse } from '@knighted/reparse'\nimport assert from 'node:assert/strict'\n\nconst ast1 = await reparse('const foo = \"bar\"')\nconst ast2 = await reparse('const foo = \"bar\"')\n\nassert.equal(ast1.span.start, ast2.span.start)\nassert.equal(ast1.span.end, ast2.span.end)\n```\n\nSync file example:\n\n```js\nimport { reparseFileSync } from '@knighted/reparse'\n\nconst ast0 = reparseFileSync('./file.ts')\nconst ast1 = reparseFileSync('./file.ts')\n\nconsole.log(ast0.span.start === ast1.span.start) // true\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightedcodemonkey%2Freparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknightedcodemonkey%2Freparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightedcodemonkey%2Freparse/lists"}