Skip to content

cotrEntry

Describes the entry point of a TypeScript application.

Aliases:

  • cotrEntry
  • entry
  • start
  • startingPoint

cpp

// C++ Entry Point
// To compile and run this program, use: `g++ filename.cpp -o output && ./output`
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}

csharp

// C# Entry Point
// To run this program, use: `dotnet run` within the project directory
class Program
{
static void Main(string[] args)
{
// Your code here
}
}

dart

// Dart Entry Point
// To run this program, use: `dart run filename.dart`
void main() {
// Your code here
}

go

// Go Entry Point
// To run this program, use: `go run filename.go`
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}

haskell

-- Haskell Entry Point
-- To run this program, use: `ghc filename.hs` or `runhaskell filename.hs`
main :: IO ()
main = do
-- Your code here

java

// Java Entry Point
// To run this program, use: `java Main.java`
public class Main {
public static void main(String[] args) {
// Your code here
}
}

javascript

// JavaScript Entry Point
// To run this program, use: `node filename.js`
console.log('Hello, World!');

javascriptreact

// JavaScript Entry Point
// To run this program, use: `node filename.js`
console.log('Hello, World!');

kotlin

// Kotlin Entry Point
// To run this program, use: `kotlinc filename.kt -include-runtime -d filename.jar && java -jar filename.jar`
fun main() {
println("Hello, World!")
}

perl

# Perl Entry Point
# To run this program, use: `perl filename.pl`
use strict;
use warnings;
print "Hello, World!\n";

php

// PHP Entry Point
// To run this program, use: `php filename.php`
<?php
echo 'Hello, World!';
?>

powershell

Terminal window
# PowerShell Entry Point
# To run this script, use: `powershell filename.ps1`
Write-Host 'Hello, World!'

python

# Python Entry Point
# To run this program, use: `python filename.py`
if __name__ == '__main__':
# Your code here

r

# R Entry Point
# To run this program, use: `Rscript filename.R`
# Your code here

ruby

# Ruby Entry Point
# To run this program, use: `ruby filename.rb`
puts 'Hello, World!'

rust

// Rust Entry Point
// To run this program, use: `cargo run`
// Note: This assumes you are using Cargo, Rust's package manager and build tool.
fn main() {
println!("Hello, World!");
}

scala

// Scala Entry Point
// To run this program, use: `scala Main.scala`
object Main extends App {
// Your code here
}

shellscript

# Bash scripts typically start with the shebang line:
#!/bin/bash

swift

// Swift Entry Point
// To run this program, use: `swift filename.swift`
import Foundation
print("Hello, World!")

typescript

// TypeScript Entry Point
// To run this program, use: `ts-node filename.ts`
// Note: Ensure you have ts-node installed globally (`npm install -g ts-node`)
console.log('Hello, World!');

typescriptreact

// TypeScript Entry Point
// To run this program, use: `ts-node filename.ts`
// Note: Ensure you have ts-node installed globally (`npm install -g ts-node`)
console.log('Hello, World!');