“So führen Sie die TypeScript -Datei aus” Code-Antworten

So führen Sie die TypeScript -Datei aus

npx ts-node src/foo.ts
Frightened Flatworm

So führen Sie die TypeScript -Datei aus

// First run the below command.
tsc hello.ts //tsc filename.ts  here in the example hello.ts is the file name for typescript.

//After running the above command a javascript file will be generated of same .ts file name.
//To run that file run the below command.
node hello.js

//And you will get your output.

//If you want to change the JS version then the command is.
tsc --target ES6 hello.ts //After this the same procedure as above.

// (For Windows Only ) If you are getting Security policy error then you may enter the command for the same or run the above command in the command prompt.
Unusual Unicorn

wie man TS in CMD kompiliert

"scripts": {
    "clean": "rimraf dist",
    "start": "npm-run-all clean --parallel watch:build watch:server --print-label",
    "watch:build": "tsc --watch",
    "watch:server": "nodemon './dist/index.js' --watch './dist'"
}
Restu Wahyu Saputra

So führen Sie die TypeScript -Datei aus

npm install -g typescript //global installation of typescript comiler-tsc
tsc <file_name>.ts  //ts file is converted to js by compiler
Vasvi Sood

Ähnliche Antworten wie “So führen Sie die TypeScript -Datei aus”

Fragen ähnlich wie “So führen Sie die TypeScript -Datei aus”

Weitere verwandte Antworten zu “So führen Sie die TypeScript -Datei aus” auf TypeScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen