Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 464 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 464 Bytes

ast-grep napi language for yaml

Installation

In a pnpm project, run:

pnpm install @ast-grep/lang-yaml
pnpm install @ast-grep/napi
# install the tree-sitter-cli if no prebuild is available
pnpm install @tree-sitter/cli --save-dev

Usage

import yaml from '@ast-grep/lang-yaml'
import { registerDynamicLanguage, parse } from '@ast-grep/napi'

registerDynamicLanguage({ yaml })

const sg = parse('yaml', `your code`)
sg.root().kind()