{"name":"acorn-typescript","version":"1.0.5","description":"Alternative, TypeScript parser","source":"src/index.ts","main":"lib/index.js","module":"lib/index.esm.js","types":"lib/index.d.ts","scripts":{"build":"microbundle --define process.env.NODE_ENV=production --no-sourcemap --tsconfig ./tsconfig.json --format esm,cjs","test":"jest --collect-coverage --silent","release-major":"standard-version --release-as major","release-minor":"standard-version --release-as minor","release-patch":"standard-version --release-as patch"},"repository":{"type":"git","url":"git+https://github.com/TyrealHu/acorn-typescript.git"},"author":{"name":"tyrealhu"},"license":"MIT","bugs":{"url":"https://github.com/TyrealHu/acorn-typescript/issues"},"homepage":"https://github.com/TyrealHu/acorn-typescript#readme","devDependencies":{"@types/estree":"^1.0.0","@types/jest":"^24.1.0","acorn":"^8.8.0","jest":"^24.1.0","microbundle":"^0.15.1","standard-version":"^9.5.0","ts-jest":"^26.0.0","ts-node":"^10.9.1","typescript":"^4.8.4"},"dependencies":{"charcodes":"^0.2.0"},"peerDependencies":{"acorn":">=8.0.0"},"gitHead":"9028ef8ba905726307a1201e2960503e218cfbbd","_id":"acorn-typescript@1.0.5","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-L9oi3H+OsfNa//zWDZGCufK1y+ohD48R5PSug2XrVbrNmKLsQShsCwmWQETirDeF7zJQ0Aw+DvMoA+ZB8clTZQ==","shasum":"35a2db643f69db5f6d6980528c4b736adfd541cd","tarball":"http://registry-npm.ywwl.com/acorn-typescript/download/acorn-typescript-1.0.5.tgz","fileCount":14,"unpackedSize":193002,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv3zy4HC7XQB+8L3tpoWzyRy8+n6OSj8oB0Pq+uV3oBgIhALES3227uKsT0myK+2rtKl+fOt3Avm1zPcq25xJkbzzy"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjv2oHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoI8BAAgz5Gw2QtQheQugmPrZ4ZmKApx8gt4zIWP369A7WtRkoI4Tss\r\noeD7dearJrSNDtGtBwPE+yOP4ibno5r3LOfY96wSW+9LuWGSpj1nE/xeFU+L\r\npNlqAgiax8IoWv0o017DFh5iua9LxL7CJy0tZdbnQ8Bhzg3wTO+yY2IqG8SF\r\nD6zLB5Yt/8dIPAFkUPL9lYbLAv/nB7DiBNIVHhiLmwj2JvPXiCIlih6gNsj+\r\njACixdlv3+iTb43DLLi151ksAibA0/U2v1aLxrd+aug3e/VVVG6IkWyYoJCt\r\nQUywDobXvVXVkyDZBSbb2tybLr/vuMT26LwfWH4VV7TD+gBg2Mc3todSGsCB\r\nBe6MqpLn5x8nJX4Gvm0jIMQ+K9JsWBMzBF0O2uIx8kYoaVz0bfMseD94y/a2\r\nhNp8kYSmHqJdeKPL2ak9lhZ2KQpDD2qIccrc2VU2Vgi5AIjg9znVuqZK5FDr\r\nxPiKtHlMdgm2gzlBXncBDR+TsAvMx2Yjlj3TGpxomDYNJ7+qmLvSjmPQ1juf\r\nejsA7eGF4c+uhmnmnLidm9sYjsMMN2edrrhzantzsYyho+aGURBGiM5vY7tF\r\nXM9c5hgNr+hVa28LsF1eCJ5PiAOin6v0NZwwiq86ZynZeHFMYeghT3HK4a2z\r\nm9YpOTe1pymRGg+lysxzFQGnsKzSC5Agkb4=\r\n=vrNj\r\n-----END PGP SIGNATURE-----\r\n","size":48372,"noattachment":false,"key":"/acorn-typescript/-/acorn-typescript-1.0.5.tgz"},"_npmUser":{"name":"tyrealhu","email":"995927270@qq.com"},"directories":{},"maintainers":[{"name":"tyrealhu","email":"995927270@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/acorn-typescript_1.0.5_1673488902866_0.10330920114996123"},"_hasShrinkwrap":false,"readme":"# acorn-typescript\n[![npm version](https://img.shields.io/npm/v/acorn-typescript.svg?style=flat)](https://www.npmjs.com/package/acorn-typescript)[![Coverage Status](https://codecov.io/gh/TyrealHu/acorn-typescript/branch/master/graph/badge.svg)](https://codecov.io/gh/TyrealHu/acorn-typescript)\n---\n\nThis is 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 script into typeScript AST.\n\n## Usage\n\nRequiring this module provides you with an Acorn plugin that you can use like this:\n\n```typescript\nimport * as acorn from 'acorn'\nimport tsPlugin from 'acorn-typescript'\n\n/*\n*\n* */\nconst node = acorn.Parser.extend(tsPlugin()).parse(`\nconst a = 1\ntype A = number\nexport {\n  a,\n  type A as B\n}\n`, {\n  sourceType: 'module',\n  ecmaVersion: 'latest',\n  locations: true\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```typescript\nimport * as acorn from 'acorn'\nimport tsPlugin from 'acorn-typescript'\n\n/*\n*\n* */\nconst node = acorn.Parser.extend(tsPlugin({ dts: true })).parse(`\nconst a = 1\ntype A = number\nexport {\n  a,\n  type A as B\n}\n`, {\n  sourceType: 'module',\n  ecmaVersion: 'latest',\n  locations: true\n})\n```\n\n## Notice\n- You have to enable options.locations while using acorn-typescript\n```ts\nacorn.parse(input, {\n    sourceType: 'module',\n    ecmaVersion: 'latest',\n    // here\n    locations: true\n  })\n```\n\n## SUPPORTED\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## RoadMap\n- support import-assertions\n\n## License\n[MIT](https://couto.mit-license.org/)\n","publish_time":1673488903047,"_cnpm_publish_time":1673488903047,"dist-tags":{"latest":"1.4.13"}}