{"name":"acorn-loose","description":"Error-tolerant ECMAScript parser","homepage":"https://github.com/acornjs/acorn","main":"dist/acorn-loose.js","module":"dist/acorn-loose.mjs","exports":{".":[{"import":"./dist/acorn-loose.mjs","require":"./dist/acorn-loose.js","default":"./dist/acorn-loose.js"},"./dist/acorn-loose.js"],"./package.json":"./package.json"},"version":"8.2.1","engines":{"node":">=0.4.0"},"dependencies":{"acorn":"^8.5.0"},"maintainers":[{"name":"marijn","email":"marijnh@gmail.com"},{"name":"adrianheine","email":"mail@adrianheine.de"},{"name":"rreverser","email":"me@rreverser.com"}],"repository":{"type":"git","url":"git+https://github.com/acornjs/acorn.git"},"scripts":{"prepare":"cd ..; npm run build:loose"},"license":"MIT","bugs":{"url":"https://github.com/acornjs/acorn/issues"},"_id":"acorn-loose@8.2.1","_nodeVersion":"16.4.0","_npmVersion":"7.18.1","dist":{"integrity":"sha512-/sVu5wCtWrX6ChLCMzBTmNkXSoyRKunTf6HjHMswzMmzIyE8vU+HYlgd2kFF/A9Av9j+b9/d/FzxrmcH0lCrBw==","shasum":"9603129133e6772d6df8b8a318e6e13d13efcaa1","tarball":"http://registry-npm.ywwl.com/acorn-loose/download/acorn-loose-8.2.1.tgz","fileCount":6,"unpackedSize":112924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNeHuCRA9TVsSAnZWagAAk2sP/1jHx0YR/8ejM65QIoic\n82OGUxpfPEubhyEPoTZt+DZfaPetyFpX0yKw4dXimjsSzCpXB/ohp6fPY9mk\nqitXe+3PQX1mE02kO6sO3qFTUyEtK2v8ZfNcE2bWm8c0myjXuIPPFsriSPJO\nXGpt0BnAM14gkDvpMnWmHh5OAMbAKa+BxIx1Xc6KKBZbM9EBVyXuaXxOFswO\nCQLrYSUWW9N7fWArp/9AgLUDirMLzi026uWFSY2A6EuB1ixMp1HggQGzVQRv\nWxLnEmNsEu8ye9rTO3llb0J9BUdcDclmbYre9H2vPfHoswXaB+DMN3SxDyN2\ncjGHwMU3+aJLPpr+j4gIZfvsiMRya0JnEuysz/ebFE362ElaFGkpIS39VAnE\nKt5tfC27BFSQDAFcqHJMoBDw2XFQ6HZeMYvp7K7jLGRmnH8nTEGJLf+Jg1OJ\nXqGjTxB3enmG+5xve4rao5OFSxhzsksWTh6gQfnwGVxmKJoetGFyFw7QWNWr\nXag+5taQYUOfsQ73tQeHaeZnSTNJ4Jnl0CDQQuKPt9W0gw2GXZ7bNXw9SmYQ\n+sSjXHuOCYOSJKM6QrdtzpJKZ5yePnpSEWaobv07XJEG8/PYs/CF8rNnUZTl\nl2kg8mvVHwqxkuYhjiQ0oCnovgHBrzoXo+qAtn0YbAqqsc0WMvJQSvodx4xm\nISD3\r\n=kQbJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCon6TRq1gAwv8oONetsFuwrFDJ+twKKbzLDISgIvRF/QIgLKSSECJdla8lTc0l8DffyRG01K9+rES9pCuCKwi1Vfg="}],"size":23002,"noattachment":false,"key":"/acorn-loose/-/acorn-loose-8.2.1.tgz"},"_npmUser":{"name":"marijn","email":"marijnh@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/acorn-loose_8.2.1_1630921198220_0.27730631322617905"},"_hasShrinkwrap":false,"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":1630921198344,"_cnpm_publish_time":1630921198344,"dist-tags":{"latest":"8.5.2"}}