Remember that fileName (string) parameter in createSourceFile is virtual file name. This fileName (string) is used globaly while using TypeScript library.
The most important thing what you need is what doc comment on createProgam method says. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' that represent a compilation unit. createProgam method as first parameter requires list of strings which are virtual names of files used in this program.
If you don't understand previous 2 theoretical paragraphs I think that comments in sample will help you.
// this is the real code of file. Use fs.readFile, fs.readFileSync or something other to load file real source code.
var code = "class 1X {}";
// I will use this virtual name to reference SourceFile while working with TypeScript API.
var virtualFileName = "aaa.ts";
// initialize SourceFile instance
var sf = ts.createSourceFile(virtualFileName, code, ts.ScriptTarget.ES5);
// Make program as collection of my one virtual file
var prog = ts.createProgram([virtualFileName], {});
// process response as you need.
console.log(prog.getSyntacticDiagnostics(sf));