Package Exports
- @ast-grep/lang-python
- @ast-grep/lang-python/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ast-grep/lang-python) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ast-grep napi language for python
Installation
In a pnpm project, run:
pnpm install @ast-grep/lang-python
pnpm install @ast-grep/napi
# install the tree-sitter-cli if no prebuild is available
pnpm install tree-sitter-cli --save-devUsage
import python from '@ast-grep/lang-python'
import { registerDynamicLanguage, parse } from '@ast-grep/napi'
registerDynamicLanguage({ python })
const sg = parse('python', `your code`)
sg.root().kind()