On their official website, the creators of ts.node collected the following features:
To get started, install ts-node globally using:
npm install -g ts-node
ts-node does not include the TypeScript compiler, if you must install it type:
npm install -g typescript
To run the main.ts script, run
ts-node main.ts // main.ts console.log("Hello world");
An example of use would be:
$ ts-node main.ts hello world
To run REPL you must run the ts-node command
$ ts-node > const sum = (a, b): number => a + b; undefined > sum(2, 2) 4 > .exit
Now, with the use of ts-node, you can run Typescript in Node.js without any problem. Always remember to check the official libraries of each technology where you will surely find the information you need to advance in the creation of your application or website.
Node.js users may worry about the process crashing as it doesn't exist. Hardly any functions in Node.js do I/O directly, so the process never hangs. Therefore, it is very conducive to developing scalable systems in Node.js.
Node is easy to use, especially for people who are new to this field. It is especially used to develop agile prototypes. It is also used to build fast and scalable services, used for companies like PayPal, Uber, Walmart.
A special case occurred at PayPal, they rebuilt one of their Java-based applications using Node, discovering that the latter developed twice as fast with fewer developers involved, 33% fewer lines of code, and 40% fewer files. They even doubled the number of requests served per second.
At Rootstack, we are constantly looking for talented developers to join our group of experts, where you will find a young and hungry community to create the applications and technologies of the present and the future.