Deno

D

Deno

Chat about Deno, a modern runtime for JavaScript and TypeScript.

Join

When I use crypto in this code, it returns 'Unknown cipher.'

const secret ="1111111111111111111"; let encryptedText='test'; const decipher = crypto.createDecipheriv('aes-256-cbc', secret, secret.slice(0, 16)); decipher.setAutoPadding(true); let decrypted = decipher.update(encryptedText.slice(16), 'base64', 'utf8');...

Troubleshooting deno.land downloads

I have docker containers, within a minikube cluster, that have trouble downloading https://deno.land/ sources. Files at raw.githubusercontent.com work fine, but files at deno.land result in "Connection reset by peer". Any ideas what's going on? I also observed this behavior when running a container directly: (Seems downloading from raw.githubusercontent.com works just fine, but then downloading from deno.land doesn't) ``` nrk@SAMWAF:~$ docker run -it --init denoland/deno:1.37.0 repl...

Run remote Fresh application code locally.

Is it possible to run a remotely hosted Fresh application? E.g. I'm attempting to do deno run -A https://raw.githubusercontent.com/cknight/dev-tools/main/main.ts but this isn't working as the deno.json file isn't loading and so the import map isn't either. I've also tried using the --config flag, but it only seems to support local files. I'm guessing to support this I would need to rework the application to remove the deno.json file? Use case: I have an application which processes sensitive data. It's best if the use runs this on their own machine, rather than a centrally hosted instance. While the user could clone the repo and run deno task start, a single (albeit, long) command line to run the application locally is attractive....

migrate from node to deno: p5js project

Hi, I want to rewrite my p5js project built with nodejs in deno. Here is my code: https://github.com/Seasawher/p5js I would like to preview it using VSCode's liverServer extension. I am a beginner and do not know how to rewrite it in deno. Any advice would be appreciated....

Peer dependency

Can I somehow mark a dependency as "peer"? So this dependency (which is known to shuffle typings between versions, but generally it is nonbreaking if you use it on highlevel) will not enforce a specific version onto a project? I depend on Pentagon and Zod Pentagon also depends on Zod...

'Spawn' multiple promises from the same module

I'm trying to use Deno for scripted npcs in a game, the main issue that the npc has to await user action so I've used a mpsc Channel for this with an async fn op which works fine. However since the npcs exists on the server side I need to be able to call the same npc multiple times on the same runtime. My current test script looks like this ```js // actor would be the current actor object...

Return results from execute_main_module

I currently have this function to run some execute some js ``` pub async fn run(&self, path_to_main_module: &Path) -> Result<()> { let main_module = ModuleSpecifier::from_file_path(path_to_main_module).maperr(|| {...

Fresh Blog + Website Things

https://vuepress-theme-yuu.netlify.app/, what is the closest thing to that which can be run on Fresh? It is for an SSG, which means the website is the theme. Another example of it is https://harmony.mod.land/ I don't really want to use such a restrictive SSG. But idk....

Determine subcommand

If I run deno test from the command line, how can I determine that test is the subcommand being run. The command is not present in Deno.args, nor Deno.mainModule Thanks in advance!...

setting a cookie for import requests

is there a way to modify request headers or set cookies for the GET requests that deno makes when resolving imports? concrete use case: I want to test a library that is served by a local static file server on my machine and forwarded through vs code's tunnel feature – but without a specific cookie, the tunnel serves a safety warning instead of the forwarded content....

How to run tailwindcss cli with deno task?

I would like to be able to run the tailwindcss cli tool to watch and build stylesheets as per their cli docs, https://tailwindcss.com/docs/installation But I can't see a way that I could do that with a deno task like a I could with an npm script? Is this a case where I have to add a package.json file or is it possible to do without that?...

Deno Deploy

Is it possible to use only cronjobs on deno deploy?

Deno cannot import mainfile by reading from package.json

deno 1.36.0 (release, x86_64-unknown-linux-gnu) v8 11.6.189.12 typescript 5.1.6...
No description

Deno LSP in a Web Worker

Has anyone come across the lsp running in a web worker? I have an online editor (Monaco) that people are using to write Typescript that runs on Deno. We can add support Deno's types relatively easily but the built-in TS lsp with Monaco doesn't support remote imports.

Module not found when running deno run

Something weird has started happening. When I run deno run src/main.ts it seems as if Deno is trying to run it from a completely bonkers file path. error: Module not found "file:///Users/me/Projects/my-project/src/Users/me/Projects/my-project/src/main.ts"....

esm_entry_point / extension macro; ReferenceError

How do I use esm_entry_point properly? I defined my extension as: ```rust extension!(...

remoteAddr returning localhost on Deno Deploy

I saw this thread (https://discord.com/channels/684898665143206084/1055631150787334184) about getting the IP of the requester, but I'm not getting the value I expected. I tried using ctx.remoteAddr with Fresh on Deno Deploy and I get { transport: "tcp", hostname: "localhost", port: 1234 } instead of an IP address – is there something I need to configure to get "real" values?...

Deno-native Nuxt.js?

The recent The State of Web Frameworks on Deno blogpost says under Nuxt:
"As with the other Node-centric frameworks in this list, we recommend using npm to manage dependencies and run local development scripts."
What are the particular reasons why this is still true, considering that npm: support is now stabilized? Is it the auto-imports which Deno can't handle? If so, would simply importing everything explicitly fix this already?...
No description

Deno support Fleet IDE?

Hello, can the deno plug-in be used on the Fleet editor of JetBrains IDEs? Thank you.