Skip to main content
Module

x/ts_morph/ts_morph.d.ts>Project#createSourceFile

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

Creates a source file at the specified file path with the specified text.

Note: The file will not be created and saved to the file system until .save() is called on the source file.

Parameters

filePath: string
  • File path of the source file.
optional
sourceFileText: string | OptionalKind<SourceFileStructure> | WriterFunction
  • Text, structure, or writer function for the source file text.
optional
options: SourceFileCreateOptions
  • Options.