npm.io
0.9.0-build.66 • Published 6 years ago

swf-tree

Licence
Version
0.9.0-build.66
Deps
4
Size
1.2 MB
Vulns
0
Weekly
0
Stars
13
Open Flash logo

SWF Tree (Typescript)

npm GitHub repository Build status

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));

Keywords