Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/bin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -312,12 +312,20 @@ Options:
stdinStuff?.repl.setService(service);

// Output project information.
if (version >= 2) {
if (version === 2) {
console.log(`ts-node v${VERSION}`);
console.log(`node ${process.version}`);
console.log(`compiler v${service.ts.version}`);
process.exit(0);
}
if (version >= 3) {
console.log(`ts-node v${VERSION} ${dirname(__dirname)}`);
console.log(`node ${process.version}`);
console.log(
`compiler v${service.ts.version} ${service.compilerPath ?? ''}`
);
process.exit(0);
}

if (showConfig) {
const ts = service.ts as any as TSInternal;
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -477,6 +477,8 @@ export interface Service {
/** @internal */
[TS_NODE_SERVICE_BRAND]: true;
ts: TSCommon;
/** @internal */
compilerPath: string;
config: _ts.ParsedCommandLine;
options: RegisterOptions;
enabled(enabled?: boolean): boolean;
Expand DownExpand Up@@ -1340,6 +1342,7 @@ export function create(rawOptions: CreateOptions = {}): Service {
return {
[TS_NODE_SERVICE_BRAND]: true,
ts,
compilerPath: compiler,
config,
compile,
getTypeInfo,
Expand Down