Skip to content

Commit 0a26520

Browse files
author
Himujjal Upadhyaya
authored
Updated README to include fallback.
Hi. Great repo. But I can't seem to work with the npx command. So, I updated the README.md to include a fallback for temporary purposes in case someone couldn't figure out what to do. This is of course temporary.
1 parent 12d37f0 commit 0a26520

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ npm i @asgerf/dts-tree-sitter
99

1010
npx @asgerf/dts-tree-sitter INPUT > OUTPUT.d.ts
1111
```
12+
If the above command fail:
13+
14+
```sh
15+
node ./node_modules/@asgerf/dts-tree-sitter/build/src/index.js INPUT > OUTPUT.d.ts
16+
```
1217

1318
where `INPUT` is used to locate a `node-types.json` file in one of the following locations:
1419
- `${INPUT}`
@@ -19,11 +24,18 @@ where `INPUT` is used to locate a `node-types.json` file in one of the following
1924
## Example
2025

2126
The `tree-sitter-javascript` grammar can be compiled like this:
27+
2228
```sh
2329
npm i tree-sitter-javascript
2430
npx @asgerf/dts-tree-sitter tree-sitter-javascript > generated.d.ts
2531
```
2632

33+
Fallback to the above command:
34+
35+
```sh
36+
node ./node_modules/@asgerf/dts-tree-sitter/build/src/index.js tree-sitter-javascript > generated.d.ts
37+
```
38+
2739
In the resulting grammar, two of the node types look like this:
2840
```ts
2941
export interface ClassDeclarationNode extends SyntaxNodeBase {

0 commit comments

Comments
 (0)