require a typescript file into javascript code example
Example 1: how to run typescript file
npx ts-node src/foo.ts
Example 2: import js file in typescript
// Add to tsconfig.json:
{
"compilerOptions": {
...
"allowJs": true
...
}
}
import MyModule from './../pages/MyModule';