@tbmini/code-parse
v1.2.4
Published
解析code
Downloads
4
Keywords
Readme
id: code-parse
对ts代码静态分析
Install
npm i -s @tbmini/code-parse
// or
yarn add @tbmini/code-parse
Usage
import { parseAllBefore } from '@tbmini/code-parse'
const project = new Project({ tsConfigFilePath: `./tsconfig.json` })
const checker = project.getTypeChecker().compilerObject
const sourceFiles = project.getSourceFiles(`./src/mini-tornado/microservice/**/beforeModule.ts`)
const beforeAnalysis = parseAllBefore(sourceFiles, checker)