how to run typescript file
npx ts-node src/foo.ts
how to run typescript file
npx ts-node src/foo.ts
how to run typescript file
// 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.
Typescript node start script
{
// ...
"scripts": {
"start": "nodemon -w src --ext ts --exec ts-node src/index.ts"
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us