Let’s take a look at several ways of how you could run a single Typescript file in the WebStorm IDE
For running our Typescript files, we will be using the ts-node npm package. In some scenarios, you will not be needed to install the package locally
If you need to run one file and see the results, you don’t need to add ts-node to your dev dependencies.
Let’s take a look at the simple example: currently, we have a single .ts file in our project examples/User.ts
.
After running this command in your terminal…
npx ts-node examples/User.ts
#javascript #webstorm #typescript