Minimal code snippets to test stuff
To launch ts code from command line, this seems to be the way:
node --experimental-specifier-resolution=node --loader ts-node/esm path/to/example/
or even
node --loader ts-node/esm path/to/example/
tsconfig.json
need the module
and target
set to something recent.
{
"compilerOptions": {
"esModuleInterop": true,
"module": "ESNext",
"target": "ES2020"
},
"include": [
"./**/*.ts"
]
}