swf-tree
v0.9.0-build.66
Published
Abstract Syntax Tree for SWF
Downloads
14
Readme
SWF Tree (Typescript)
Typescript implementation of the SWF Abstract Syntax Tree (AST).
Usage
# Run as a simple user
npm install -S swf-tree
import {readFileString} from "fs";
import {Movie} from "swf-tree";
// Deserialize
const jsonString: string = readFileString("ast.json").toString("utf8");
const parsedJson: Movie.Json = JSON.parse(jsonString);
const movie: Movie = Movie.Type.read("json", parsedJson);
// Serialize
const emittedJson: Movie.Json = Movie.Type.write("json", movie);
console.log(JSON.stringify(jsonMovie, null, 2));