installing typescript npm code example
Example 1: install typescript
npm install -g typescript
Example 2: how to install typescript in windows 10
npm install -g typescript
Example 3: install typescript
Don't forget to use the dev flag!!!
Yarn:
yarn global add --dev typescript
NPM:
npm install -g --save-dev typescript
Example 4: npm typescript package
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"allowJs": true,
"strict": true,
"outDir": "./lib",
"esModuleInterop": true
},
"include": ["src"],
"exclude": ["node_modules"]
}
Example 5: npm typescript package
const demoMethod = () => {
return “I’m Duffer”;
}
module.exports = demoMethod;