| Crates.io | tree-sitter-vue-updated |
| lib.rs | tree-sitter-vue-updated |
| version | 0.1.0 |
| created_at | 2025-09-11 20:42:42.85922+00 |
| updated_at | 2025-09-11 20:42:42.85922+00 |
| description | vue grammar for the tree-sitter parsing library |
| homepage | |
| repository | https://github.com/c-gamble/tree-sitter-vue |
| max_upload_size | |
| id | 1834523 |
| size | 276,884 |
Vue (Vue v2.6.0 Template Syntax) grammar for tree-sitter
Note: This grammar is not responsible for parsing embedded languages, see Multi-language Documents for more info.
npm install tree-sitter-vue tree-sitter
const Parser = require("tree-sitter");
const Vue = require("tree-sitter-vue");
const parser = new Parser();
parser.setLanguage(Vue);
const sourceCode = `
<template>
Hello, <a :[key]="url">{{ name }}</a>!
</template>
`;
const tree = parser.parse(sourceCode);
console.log(tree.rootNode.toString());
// (component
// (template_element
// (start_tag
// (tag_name))
// (text)
// (element
// (start_tag
// (tag_name)
// (directive_attribute
// (directive_name)
// (directive_dynamic_argument
// (directive_dynamic_argument_value))
// (quoted_attribute_value
// (attribute_value))))
// (interpolation
// (raw_text))
// (end_tag
// (tag_name)))
// (text)
// (end_tag
// (tag_name))))
MIT © Ika