// Note: "import" should generally be used for modules/package projects, otherwise use
// "require"
// In your NodeJS project's package.json add the following "type" field to allow use of "import":
{
"type": "module"
}
{
...
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": true
}
}
<script type="module" src="source.js"></script>