Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

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

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

Synchronously 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

ts.SourceFile | undefined