1Don't forget to use the dev flag!!!
2Yarn:
3yarn global add --dev typescript
4NPM:
5npm install -g --save-dev typescript
1{
2 "compilerOptions": {
3 "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
4 "module": "commonjs",
5 "allowJs": true, /* Allow javascript files to be compiled. */
6 "strict": true, /* Enable all strict type-checking options. */
7 "outDir": "./lib", /* Redirect output structure to the directory. */
8 "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
9 },
10 "include": ["src"],
11 "exclude": ["node_modules"]
12}
13
1const demoMethod = () => {
2return “I’m Duffer”;
3}
4module.exports = demoMethod;
5