ts-file-parser
v0.0.21
Published
This repository provides a parser for `*.ts` files. It parses the structure of a file and provides JSON object that contains its declaration.
Downloads
1,342
Maintainers
Readme
TypeScript File Parser
This repository provides a parser for *.ts
files. It parses the structure of a file and provides JSON object that contains its declaration.
Usage
import tsFileStruct = require("ts-file-parser")
var filePath = "./src/typescript-file.ts";
var decls = fs.readFileSync(filePath).toString();
var jsonStructure = tsFileStruct.parseStruct(decls, {}, filePath);