Last active
May 24, 2017 00:07
-
-
Save stelcheck/c26d97cc9af9905ca9bdf3729215ebc2 to your computer and use it in GitHub Desktop.
TypeScript Compiler API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as path from 'path' | |
import * as ts from 'typescript' | |
const glob = require('glob') | |
const globPattern = path.join(this.projectPath, 'lib/modules/**/usercommands/*.ts') | |
const userCommandFiles = glob.sync(globPattern) | |
// Build a program using the set of root file names in fileNames | |
const program = ts.createProgram(this.userCommandFiles, { | |
target: ts.ScriptTarget.ES2017, module: ts.ModuleKind.CommonJS | |
}) | |
// Get the checker, we will use it to find more about classes | |
const checker = this.program.getTypeChecker() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment