{"name":"acorn-loose","version":"8.5.0","license":"MIT","_id":"acorn-loose@8.5.0","maintainers":[{"name":"marijn","email":"marijn@haverbeke.berlin"},{"name":"adrianheine","email":"mail@adrianheine.de"},{"name":"rreverser","email":"me@rreverser.com"}],"homepage":"https://github.com/acornjs/acorn","bugs":{"url":"https://github.com/acornjs/acorn/issues"},"dist":{"shasum":"11fbd555827d551dd16ca812c078e382400b1bc7","tarball":"http://registry-npm.ywwl.com/acorn-loose/download/acorn-loose-8.5.0.tgz","fileCount":8,"integrity":"sha512-ppga7pybjwX2HSJv5ayHe6QG4wmNS1RQ2wjBMFTVnOj0h8Rxsmtc6fnVzINqHSSRz23sTe9IL3UAt/PU9gc4FA==","signatures":[{"sig":"MEQCIFYcwCVG6c1oNEmhkfc4H4q9+RfQKsqzS0nG+L5wlWesAiBnp/4iJOMV6Ze0lqg90ntpE/8SBOIt2hhorPQxF4VYzA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120555,"size":25243,"noattachment":false,"key":"/acorn-loose/-/acorn-loose-8.5.0.tgz"},"main":"dist/acorn-loose.js","types":"dist/acorn-loose.d.ts","module":"dist/acorn-loose.mjs","engines":{"node":">=0.4.0"},"exports":{".":[{"import":"./dist/acorn-loose.mjs","default":"./dist/acorn-loose.js","require":"./dist/acorn-loose.js"},"./dist/acorn-loose.js"],"./package.json":"./package.json"},"gitHead":"0d046aa11da7a8e545eda830037675f75d4d88bc","scripts":{"prepare":"cd ..; npm run build:loose"},"_npmUser":{"name":"marijn","email":"marijn@haverbeke.berlin"},"repository":{"url":"git+https://github.com/acornjs/acorn.git","type":"git"},"_npmVersion":"10.9.2","description":"Error-tolerant ECMAScript parser","directories":{},"_nodeVersion":"22.14.0","dependencies":{"acorn":"^8.14.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/acorn-loose_8.5.0_1744869099984_0.5158378736059914","host":"s3://npm-registry-packages-npm-production"},"readme":"# Acorn loose parser\n\nAn error-tolerant JavaScript parser written in JavaScript.\n\nThis parser will parse _any_ text into an\n[ESTree](https://github.com/estree/estree) syntax tree that is a\nreasonable approximation of what it might mean as a JavaScript\nprogram.\n\nIt will, to recover from missing brackets, treat whitespace as\nsignificant, which has the downside that it might mis-parse a valid\nbut weirdly indented file. It is recommended to always try a parse\nwith the regular `acorn` parser first, and only fall back to this\nparser when that one finds syntax errors.\n\n## Community\n\nAcorn is open source software released under an\n[MIT license](https://github.com/acornjs/acorn/blob/master/acorn-loose/LICENSE).\n\nYou are welcome to [report\nbugs](https://github.com/acornjs/acorn/issues) or create pull requests\non [github](https://github.com/acornjs/acorn).\n\n## Installation\n\nThe easiest way to install acorn-loose is from [`npm`](https://www.npmjs.com/):\n\n```sh\nnpm install acorn-loose\n```\n\nAlternately, you can download the source and build acorn yourself:\n\n```sh\ngit clone https://github.com/acornjs/acorn.git\ncd acorn\nnpm install\n```\n\n## Interface\n\n**parse**`(input, options)` takes an input string and a set of options\n(the same options as\n[acorn](https://github.com/acornjs/acorn/blob/master/acorn/README.md)\ntakes), and returns a syntax tree, even if the code isn't\nsyntactically valid. It'll insert identifier nodes with name `\"✖\"` as\nplaceholders in places where it can't make sense of the input. Depends\non the `acorn` package, because it uses the same tokenizer.\n\n```javascript\nvar acornLoose = require(\"acorn-loose\");\nconsole.log(acornLoose.parse(\"1 / * 4 )[2]\", {ecmaVersion: 2020}));\n```\n\nLike the regular parser, the loose parser supports plugins. You can\ntake the **`LooseParser`** class exported by the module, and call its\nstatic `extend` method with one or more plugins to get a customized\nparser class. The class has a static `parse` method that acts like the\ntop-level `parse` method.\n\n**isDummy**`(node)` takes a `Node` and returns `true` if it is a dummy node\ninserted by the parser. The function performs a simple equality check on the\nnode's name.\n","publish_time":1744869100178,"_cnpm_publish_time":1744869100178,"dist-tags":{"latest":"8.5.2"}}