Files
motia/.npm-cache/_cacache/content-v2/sha512/2e/73/df85003d71f3283fb94d2dd6614520576a7ab9ade931d0e3a49ddaec0fbe7b2a36ecd827d3d991df40f240ea076453af3c7541c2a0f7a9137bc66e452723
2025-10-19 14:57:07 +00:00

1 line
6.2 KiB
Plaintext

{"_id":"python-ast","_rev":"1-bd73c82d2242eb84b4de0866cb9ed4ce","name":"python-ast","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"python-ast","version":"0.1.0","description":"Python Parser for JavaScript/TypeScript, based on antlr4ts","main":"dist/index.js","typings":"dist/index.d.ts","license":"MIT","repository":{"type":"git","url":"https://github.com/lexanth/python-ast"},"author":{"name":"Alex Anthony","email":"alex.anthony2@gmail.com"},"keywords":["ast","python","parser","antlr","antlr4ts","abstract syntax tree","parse python","python parser"],"scripts":{"build":"ts-node build.ts","update":"ts-node update.ts","format":"prettier --write build.ts update.ts src/**.ts **/*.json","prepublish":"yarn build","precommit":"lint-staged","postcommit":"git update-index --again","test":"jest"},"devDependencies":{"@types/jest":"^26.0.4","@types/node":"^14.0.22","@types/node-fetch":"^2.5.7","@types/rimraf":"^3.0.0","@typescript-eslint/eslint-plugin":"^3.8.0","@typescript-eslint/parser":"^3.8.0","antlr4ts-cli":"^0.5.0-alpha.3","eslint":"^7.6.0","husky":"^4.2.5","jest":"^26.1.0","lint-staged":"^10.2.11","node-fetch":"^2.6.0","prettier":"^2.0.5","rimraf":"^3.0.2","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.6"},"dependencies":{"antlr4ts":"^0.5.0-alpha.3"},"lint-staged":{"*.{js,json}":["prettier --write","git add"],"*.ts":["prettier --write","eslint --fix","git add"]},"jest":{"transform":{"^.+\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"]},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Alex Anthony and contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_id":"python-ast@0.1.0","dist":{"shasum":"452ad08f866f7c2864e57e285f6c94d24b68c500","integrity":"sha512-uMPE7HRMfsbHtQYPg/+EH9MJkynLfLr+0VJbeBgJHpt2wuDgf5hZrEczOIGNFKaO0W1HWiL7bSxA/EOOo70mIQ==","tarball":"https://registry.npmjs.org/python-ast/-/python-ast-0.1.0.tgz","fileCount":21,"unpackedSize":595302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLIj2CRA9TVsSAnZWagAAaP4P/j4kVLPs8iFa3DsDiEXf\nlrD9RemyT7oMg8Wr5a0Smht0R8C+3NQ2ynNshP//wH1MyT1j/ZZrmuhaWL45\nU8pW+iD65Rii8qGl8NRr4If8oRAaKkx5TnqgDTWqxsJqz1GjIP1UuifpTDDG\nuMRgT50k66QRUesR0LUeeCaO+zAOn1RhUZ///iNXB5lPx8ncCf0D8hsx6kGa\ncgj182xNzVvg5KjQajH9dY7qaVK7pxUN16LgqZEIHelNt05LRT3dmWnvwPwQ\nvJKDthgFC8fKEdHk2VlryZ1jTWzzLtrpKQtLFazUfgI+lWDjigQLV3FE7U/9\nN6KlDbjNlL1EOYmh+QlpjTrFwSJQf6N59HeYXMFUL5dGVDyLTXhUUj1/MJHa\nJcN0q+7qGyNxb87UmwLesQSHq/3ld7q4T9f292Pq6l1eIVShsDKrxixr1efo\njephkIBp0WnSFSlxd/fnor5+tZiErPqrobMfWqePKcsQN02lGI4+MfdGO79O\n20E5fN3XDZ95xtaSpIN2mGH5Fq2T7dkwWR/QXeG1bKXosEtP4Zwvp7sgc8tl\nFUZhT9t2NtRQOYE/7LT42lrXAuTjcubjgn3XMK8fxOIhkL43ySA2g/80uDc8\nl4VWml7ZH9iMGvR3+PZ9eAxGAk1dj71O9GHt7NipxsxF72FrQh1vNS2Rd1vL\nO06Y\r\n=EE+1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZbW663X7xwu0kYP89bwGBPpJIJ6WMYBksU8rQ4CdT+QIhAP+MDMamr5iNsSeRjLHa8HehyW6AYHdNwjFkQnabysTU"}]},"maintainers":[{"name":"lexant","email":"alex.anthony2@gmail.com"}],"_npmUser":{"name":"lexant","email":"alex.anthony2@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/python-ast_0.1.0_1596754166133_0.11699692174873078"},"_hasShrinkwrap":false}},"time":{"created":"2020-08-06T22:49:26.133Z","0.1.0":"2020-08-06T22:49:26.300Z","modified":"2022-05-13T18:18:27.766Z"},"maintainers":[{"name":"lexant","email":"alex.anthony2@gmail.com"}],"description":"Python Parser for JavaScript/TypeScript, based on antlr4ts","keywords":["ast","python","parser","antlr","antlr4ts","abstract syntax tree","parse python","python parser"],"repository":{"type":"git","url":"https://github.com/lexanth/python-ast"},"author":{"name":"Alex Anthony","email":"alex.anthony2@gmail.com"},"license":"MIT","readme":"# python-ast\n\nPython (3) Parser for JavaScript/TypeScript, based on [antlr4ts](https://www.npmjs.com/package/antlr4ts), grammar taken from [antlr4's python grammar](https://github.com/antlr/grammars-v4/tree/master/python/python3-ts) too (so please report bugs and open pull requests related to grammars upstream)\n\n[![npm version](https://img.shields.io/npm/v/python-ast.svg)](https://www.npmjs.com/package/python-ast)\n\n<!-- [![Build Status](https://travis-ci.org/urish/java-ast.png?branch=master)](https://travis-ci.org/urish/java-ast) -->\n\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\nSingificantly based on [java-ast](https://github.com/urish/java-ast) - all credit to [Urish](https://github.com/urish)\n\n## Usage Example\n\n```typescript\nimport { parse, createVisitor } from 'python-ast';\n\nconst countMethods = (source: string) => {\n let ast = parse(source);\n\n return createVisitor({\n visitFuncdef: () => 1,\n defaultResult: () => 0,\n aggregateResult: (a, b) => a + b,\n }).visit(ast);\n};\n\nconsole.log(\n countMethods(`\nclass A:\n a: int\n\n def b(self):\n pass\n \n def c(self):\n pass\nclass B:\n def z(self, i):\n pass\n `),\n); // logs 3\n```\n","readmeFilename":"README.md"}