Npm

PHOTO EMBED

Thu Aug 26 2021 02:17:41 GMT+0000 (UTC)

Saved by @huilt1232

npm init

npm install  ts-node typescript @types/node

tsconfig.json      
{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "lib": ["es6", "dom"],
        "sourceMap": true,
        "allowJs": true,
        "jsx": "react",
        "esModuleInterop":true,
        "moduleResolution": "node",
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "noImplicitAny": true,
        "strictNullChecks": true,
        "suppressImplicitAnyIndexErrors": true,
        "noUnusedLocals": true
    },
    "exclude": [
        "node_modules",
        "build",
        "scripts",
        "index.js"
    ]
}

--to run ts file
"scripts": {
    "start": "ts-node main.ts",
    "test": "echo \"Error: no test specified\" && exit 1"
}
npx ts-node app.ts
content_copyCOPY