I'm using Deno (v2) as an alternative to Bash Scripting, and I'm looking for an equivalent to Bash's Source statement, to include any common functions I might write. Of course, import { something } from "./myfunctions,ts" works fine as a relative path, And an absolute path works too, import { something } from "/home/john/.deno/mylibraries/myfunctions.ts". But this hard codes my username in the path.
I have found that dynamic imports can be used to avoid this ,
I also thought that a webserver might work, import { something } from "http://localhost/myfunctions.ts"; and it nearly does, shown by the intelisense in vscode, but running gives the error, Expected a JavaScript or TypeScript module, but identified a Unknown module
Are their any other/better ways of importing modules? I don't want to make my files public so don't want to use Github Perhaps I could self-host Gitea But all seem overly complex compared to Bash's Source command.