Skip to main content
Module

x/ts_morph/bootstrap/ts_morph_bootstrap.d.ts>Project#addSourceFileAtPathIfExists

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
method Project.prototype.addSourceFileAtPathIfExists
import { Project } from "https://deno.land/x/ts_morph@15.1.0/bootstrap/ts_morph_bootstrap.d.ts";

Asynchronously adds a source file from a file path if it exists or returns undefined.

Will return the source file if it was already added.

Parameters

filePath: string
  • File path to get the file from.
optional
options: { scriptKind?: ts.ScriptKind; }
  • Options for adding the file.

Returns

Promise<ts.SourceFile | undefined>