Parse

The parse method can returns a uniform parse table data structure. Unlike many parsers that typically generate an AST, Æsthetic follows a distinct path. Its implementation of Sparser results in a uniform table-like structure.

Basic Usage

import esthetic from "esthetic";

const input = `<div class="block">{% if x %}Hello World{% endif %}</div>`;

try {

  const data = esthetic.parse(sample)
  console.log(data)

} catch(e) {

  console.error(e)

}