D
Deno

help

Linking to external code

Cch_ar.8/11/2023
if i want to link to external code, do i have to import it from https://deno.land?
Deno
Deno — A modern runtime for JavaScript and TypeScript
Deno is a simple, modern runtime for JavaScript and TypeScript that uses V8 and is built in Rust.
IioB8/11/2023
No, code can be imported from any link on the internet!
Cch_ar.8/11/2023
so i could import from this? https://github.com/USER/REPO/blob/main/index.js
IioB8/11/2023
you'd have to use the raw github link since github by default serves the content as HTML
Cch_ar.8/11/2023
ah right, thank you!
IioB8/11/2023
so: https://raw.githubusercontent.com/USER/REP/main/index.js
ABAltair 680b8/11/2023
On githug, go to the file you want. In the upper right, click the 'raw' button.
You can then copy the URL from the browsers address bar.
Jjeff.hykin8/17/2023
you can also link to a specific commit if you want to make sure it's a pinned version of the Github import
https://raw.githubusercontent.com/USER/REP/COMMIT_HASH/index.js`
https://raw.githubusercontent.com/USER/REP/COMMIT_HASH/index.js`
MGMark G8/31/2023
There are also some services that provide nicer URLs for github content, that follow the .../name@version/... convention, eg: https://ghuc.cc/, https://www.jsdelivr.com/?docs=gh
jsDelivr
jsDelivr - A free, fast, and reliable CDN for JS and Open Source
Optimized for JS and ESM delivery from npm and GitHub. Works with all web formats. Serving more than 150 billion requests per month.

Looking for more? Join the community!

Recommended Posts
Impossible to install Deno on Linux Ubuntu LTS (22.04) x86_64Hello Context & Tech : Trying to install Deno on Linux Ubuntu LTS v22.04 on x86_64 architecture PrGet length of video (stream. m3u8)In deno/typescript, how can i get the length of a specific video stream (m3u8)?github account blocked errori changed email my old account to another account and when i login to deno deploy with that account npm:axios not returning anythingI'm trying to troubleshoot a problem with axios (the same snippet works fine on node). I'm callingextension method returning undefined for `text/plain`Given the following: ```ts console.log( "text/plain", extension("text/plain"), extensioServing multiple static files to an HTTP requestIf a client sends a request for an array of static files names like so. ```["component01.js", "compoKv encodes integer as doubleAnyone know why Deno.kv encodes an integer in a mutli-part key as a double? ``` const key = ["int",Looking for caching API ResponsesHello there, I'm looking for a package/or examples to cache API responses for a fresh project whicUsing ZeroMQ from NPMAnyone got fixed the same error as this issue? https://github.com/denoland/deno/issues/18345Trying to pass parameters to runtime from rustHi, I'm launching a deno runtime from my project's code. I'm trying to pass some dynamic json variconsole.log in a worker - capture or hide output?Running under `deno repl` with no permissions, this prints 'yee'. In a browser's dev tools it would Deno debugging configuration is missing?```json "deno.enable": true, "deno.unstable": true, "deno.enablePaths": ["./api"], "deno.docIs there a way to show permissions used on start up during runtime?For example: If I was to run an App with `permissions: --allow-net=${hostname}:${port}` is there a wrestrict path applied for import mapshi, is it possible to restrict importmap application to only specific path? the rationale is: - vscoBest way to pass backend data to SSR rendered view?Looking for the "proper" way to pass data to an SSR rendered view. My first idea is setting custom pImport mapHi I have this in deno.json: ``` "imports": { "./app.controller": "./app.controller.ts", ``` butWhat should I specify to pass a "char *" in Deno.dlopen?For example, this is how you would use it in Python: ```python import ctypes lib = ctypes.cdll.LoadOverride NPM package dependencyRelating to my question yesterday (https://canary.discord.com/channels/684898665143206084/1137532072VS Code's debugger terminates before finishedI notice that occasionally the debugger terminates at the middle of the running, or at least doesn'tI need some guidance regarding interprocess communication with DenoWhat are good cross-platform (Windows, Linux) options for interprocess communication / data sharing