mkdir minimal-ts && cd minimal-tsyarn init --yesto init project and create a package.jsonyarn add typescript -Dto add thetsc- Add
tscscript into the package.json yarn tsc --initto generate the tsconfig.json file- Created index.ts file with an hello world arrow-function
yarn tscto generate the index.js transpiled file
Input (index.ts):
const helloWorld = () => {
console.log("hello world");
};Output (index.js):
"use strict";
var helloWorld = function () {
console.log("hello world");
};