Skip to content

Comment on Deno 1.14parent

Comments

Thanks for that,Oh dear, I was secretly hoping for something as easy as a new package.json. A quick look around, I found this: Opine attempts to solve this by completely porting ExpressJS over to TypeScript in Deno, making changes only where the Deno APIs dramatically differ from Node.

Will give it a try, really curious how importing works and all.

really curious how importing works and all.

So was I, so this is what I determined, on top of the official docs.[1]

On deno run of a script, it will download referenced imports and put them into a cache directory with a hash of the name. On a UNIX-like, this seems to be in ~/.cache/deno/deps (there's also a ~/.cache/deno/gen for the TS to JS stuff). Subsequent runs do not seem to download the scripts, but instead use the cached hashed versions. There's probably a way to blow out or overwrite the cache with newer download with a deno command, but I'm not sure what it is.

Compiling bundled the cached dependencies, so they aren't downloaded on run. Importing from local files is also possible, as noted in the docs I linked.

I'm happy to be corrected to supplemented on any of that info, I would rather know the actual way it works than persist in a slightly wrong assumption. :)

1: https://deno.land/manual@v1.11.5/examples/import_export

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.