You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module provides Node.js bindings to the [tree-sitter] parsing library.
8
+
9
+
## Installation
7
10
8
11
```sh
9
12
npm install tree-sitter
10
13
```
11
14
12
-
### Usage
15
+
## Basic Usage
16
+
17
+
### Prerequisites
18
+
19
+
First, you'll need a Tree-sitter grammar for the language you want to parse. There are many [existing grammars][grammars],
20
+
such as [tree-sitter-javascript][javascript]. These grammars can typically be installed with a package manager like NPM,
21
+
so long as the author has published them.
22
+
23
+
```sh
24
+
npm install tree-sitter-javascript
25
+
```
26
+
27
+
You can also develop a new grammar by using the [Tree-sitter CLI][cli] and following the [docs][docs].
13
28
14
-
First, you'll need a Tree-sitter grammar for the language you want to parse. There are many [existing grammars](https://github.com/tree-sitter) such as [tree-sitter-javascript](http://github.com/tree-sitter/tree-sitter-javascript) and [tree-sitter-go](http://github.com/tree-sitter/tree-sitter-go). You can also develop a new grammar using the [Tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/tree/master/cli).
29
+
### Parsing Source Code
15
30
16
31
Once you've got your grammar, create a parser with that grammar.
0 commit comments