Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segevfiner/node-tree-sitter-compat
Compatibility module for old v8 API based language bindings for node-tree-sitter
https://github.com/segevfiner/node-tree-sitter-compat
binding javascript nodejs tree-sitter
Last synced: 2 months ago
JSON representation
Compatibility module for old v8 API based language bindings for node-tree-sitter
- Host: GitHub
- URL: https://github.com/segevfiner/node-tree-sitter-compat
- Owner: segevfiner
- License: mit
- Created: 2024-04-16T22:04:42.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-26T22:24:05.000Z (3 months ago)
- Last Synced: 2024-09-27T10:40:10.800Z (3 months ago)
- Topics: binding, javascript, nodejs, tree-sitter
- Language: C++
- Homepage: https://www.npmjs.com/package/tree-sitter-compat
- Size: 184 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-tree-sitter-compat
Compatibility module for old v8 API based language bindings for node-tree-sitter.Grammars should be updated by running `tree-sitter generate` so they no longer require this. Also
note that the old grammar bindings were not context aware (Won't work in Electron and/or workers).This is a no-op if called an a Node API based language bindings so you can always just call it on
all your languages to have support for both old and new ones.## Usage
```ts
import { convertLanguage } from 'tree-sitter-compat';
import Parser from 'tree-sitter';
import JavaScript from 'tree-sitter-javascript';const parser = new Parser();
parser.setLanguage(convertLanguage(JavaScript));
```