Within your npm project, run the following command to install the compiler:
npm install typescript --save-devthen, the compiler is installed in the node_modules directory and can be run with:
npx tscwe can use the following command and configured the compiler by using a tsconfig.json
npx tsc --initthe config example it may be:
{
"include": ["src"],
"compilerOptions": {
"outDir": "./build"
}
}Typescript files located in the src/ directory of your project, into JS files in build/ directory