svelte_ast 1.0.0-25.beta copy "svelte_ast: ^1.0.0-25.beta" to clipboard
svelte_ast: ^1.0.0-25.beta copied to clipboard

Parser and utilities for SvelteDart template compiler.

example/example.dart

// ignore_for_file: avoid_print

import 'dart:convert';

import 'package:svelte_ast/svelte_ast.dart';

const String content = '''
<script>
  int count = 0;

  void onClick() {
    count += 1;
  }
</script>
<button on:click={onClick}>
  Count: {count}
</button>''';

void main() {
  // Create an AST tree by parsing an SvelteDart template.
  Root root = parse(content);

  // Print to console.
  print(const JsonEncoder.withIndent('  ').convert(root.toJson()));
}
0
likes
150
points
312
downloads

Publisher

unverified uploader

Weekly Downloads

Parser and utilities for SvelteDart template compiler.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

_fe_analyzer_shared, analyzer, csslib, logging, meta, pub_semver, source_span

More

Packages that depend on svelte_ast