{"_id":"@sveltejs/acorn-typescript@1.0.13","bugs":{"url":"https://github.com/sveltejs/acorn-typescript/issues"},"dist":{"shasum":"8c7c3cc7014e212f2e8fccee0159dbecfe602405","tarball":"http://registry-npm.ywwl.com/@sveltejs/acorn-typescript/download/@sveltejs/acorn-typescript-1.0.13.tgz","fileCount":5,"integrity":"sha512-wgKggnhZVL9Bfx1OaKKTrYY9BFRk6C8UAkQNUcIv1+llzYrIqy+RZm5HPKzn0NpEBvTVhTqB4kQyllZywsRBRQ==","signatures":[{"sig":"MEYCIQCadbWc+NgWLHxL7oOyrBctk2ITJOAwUXJgBf95++tqewIhAOoaKJ6bgp/yeqoOQOEEmcsDKkqT+A+X+ijRQH4XU82f","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCVO494wjEFe87tW3DoxGV3Yemqro5/uEXrBtY6a4Fc6AIhAKGm7ZYvc7x0C4DbsM9yU7m6ER9Aq4PYIdAB0mS/4tmj"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@sveltejs%2facorn-typescript@1.0.13","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":220316,"size":45155,"noattachment":false,"key":"/@sveltejs/acorn-typescript/-/@sveltejs/acorn-typescript-1.0.13.tgz"},"name":"@sveltejs/acorn-typescript","type":"module","_from":"file:sveltejs-acorn-typescript-1.0.13.tgz","types":"index.d.ts","author":{"name":"tyrealhu and the Svelte team"},"exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"license":"MIT","scripts":{"lint":"prettier --check .","test":"vitest run","build":"esbuild src/index.ts --bundle --format=esm --outfile=index.js --platform=node --external:acorn","check":"tsc --noEmit","format":"prettier --write .","playground":"pnpm build && node ./playground/index.js","test:update":"cross-env UPDATE_SNAPSHOT=true vitest run && pnpm run format","test:test262":"pnpm run build && node ./test/run_test262.js","changeset:release":"changeset publish","changeset:version":"changeset version && git add --all"},"version":"1.0.13","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d9b53ede-03fe-4170-b6a2-21fa72c0a253"}},"homepage":"https://github.com/sveltejs/acorn-typescript#readme","_resolved":"/tmp/4cac84a1e7a958d3e2874feb93e1de85/sveltejs-acorn-typescript-1.0.13.tgz","_integrity":"sha512-wgKggnhZVL9Bfx1OaKKTrYY9BFRk6C8UAkQNUcIv1+llzYrIqy+RZm5HPKzn0NpEBvTVhTqB4kQyllZywsRBRQ==","repository":{"url":"git+https://github.com/sveltejs/acorn-typescript.git","type":"git"},"_npmVersion":"11.16.0","description":"Acorn plugin that parses TypeScript","directories":{},"maintainers":[{"name":"rich_harris","email":"richard.a.harris@gmail.com"},{"name":"svelte-admin","email":"richard.a.harris+svelte@gmail.com"},{"name":"conduitry","email":"npm@chor.date"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"acorn":"^8.14.0","vitest":"^3.0.7","esbuild":"^0.25.0","test262":"git+https://github.com/tc39/test262.git#88ebb1e3755198cd08757bca1698effbbf360345","prettier":"~3.5.2","acorn-jsx":"~5.3.2","cross-env":"^7.0.3","typescript":"^5.7.3","@changesets/cli":"^2.27.11","test262-parser-runner":"^0.5.0","@changesets/changelog-github":"1.0.0-next.6"},"peerDependencies":{"acorn":"^8.9.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/acorn-typescript_1.0.13_1786619638281_0.36364310408323"},"readme":"# @sveltejs/acorn-typescript\n\n[![License](https://img.shields.io/npm/l/svelte.svg)](LICENSE.md) [![Chat](https://img.shields.io/discord/457912077277855764?label=chat&logo=discord)](https://svelte.dev/chat)\n\nThis is a plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript.\n\nIt was created as an experimental alternative, faster [TypeScript](https://www.typescriptlang.org/) parser. It will help you to parse\nTypeScript using Acorn.\n\n## Usage\n\nTo get started, import the plugin and use Acorn's extension mechanism to register it. You have to enable `options.locations` while using `@sveltejs/acorn-typescript`.\n\n```typescript\nimport { Parser } from 'acorn';\nimport { tsPlugin } from '@sveltejs/acorn-typescript';\n\nconst node = Parser.extend(tsPlugin()).parse(\n\t`\nconst a = 1\ntype A = number\nexport {\n  a,\n  type A as B\n}\n`,\n\t{\n\t\tsourceType: 'module',\n\t\tecmaVersion: 'latest',\n\t\tlocations: true\n\t}\n);\n```\n\nIf you want to enable parsing within a TypeScript ambient context, where certain syntax have different rules (like `.d.ts` files and inside [declare module blocks](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)):\n\n```typescript\nimport { Parser } from 'acorn';\nimport { tsPlugin } from '@sveltejs/acorn-typescript';\n\nconst node = Parser.extend(tsPlugin({ dts: true })).parse(\n\t`\nconst a = 1\ntype A = number\nexport {\n  a,\n  type A as B\n}\n`,\n\t{\n\t\tsourceType: 'module',\n\t\tecmaVersion: 'latest',\n\t\tlocations: true\n\t}\n);\n```\n\n## SUPPORTED\n\n- Typescript normal syntax\n- Support to parse TypeScript [Decorators](https://www.typescriptlang.org/docs/handbook/decorators.html)\n- Support to parse JSX & TSX\n\n## CHANGELOG\n\n[click](./CHANGELOG.md)\n\n## Acknowledgments\n\nWe want to thank [TyrealHu](https://github.com/TyrealHu) for his original work on this project. He maintained [`acorn-typescript`](https://github.com/TyrealHu/acorn-typescript) until early 2024.\n","publish_time":1786619638374,"_cnpm_publish_time":1786619638374,"dist-tags":{"latest":"1.0.13"}}