Deno

D

Deno

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

Join

Using `Deno.FsFile.prototype.readable` with `Response`

I was trying to stream a file into a response with the snippet: ```ts const file = await Deno.open(path); const resp = new Response(file.readable); file.close();...

react-helmet-async missing HelmetProvider export

I'm on the canary version testing out jsxImportSourceTypes and ran into an issue when switching to using npm specifiers for react@18.0.2. I have the following entry in my deno.jsonc imports.
"react-helmet-async": "npm:react-helmet-async@2",
"react-helmet-async": "npm:react-helmet-async@2",
My editor has no issue showing that it recognizes the HelmetProvider. You can see in the attached screenshots that it is recognizing that I'm importing the class. However, when my code runs, I get the following error....
No description

Where has std/hash/sha3.ts gone?

Basically what the title says. This was removed from std/ at some point, but I can't find the current location of the module anymore (looking it up on deno.land returns nothing).

Loading a module with `.load_main_es_module_from_code()` and TS module loader doesn't transpile

While working on a script runtime I ran into a curious issue where the main module I load doesn't get transpiled. This may well be my lack of understanding of how deno_core crate works but the case seemed so mind boggling to me I created a small repo for reproduction. The TLDR is: 1. I have a script.ts that I load and evaluate at runtime. 2. The script.ts uses functions from a helper library script-api.ts...

StaticModuleLoader: why must the ModuleSpecifier be a URL?

hey everyone, I'm trying to pass a StaticModuleLoader to my runtime to enable specific imports. Each module for the StaticModuleLoader is specified by a ModuleSpecifier (type alias for url::Url) and the corresponding code (impl IntoModuleCodeString). I'm wondering why the module has to be specified by a url. I read here https://choubey.gitbook.io/internals-of-deno/foundations/resolve_url_or_path that the url is crucial because it allows Deno to locate and access the modules. But I'm already providing the code in form of the value that implements IntoModuleCodeString. If I want to enable an import such as import foo from "bar"; in the code that runs on the runtime, what would the ModuleSpecifier url look like that I have to pass to the StaticModuleLoader?...

Writing CSS in Fresh

Are there any alternatives in how we write CSS other than Tailwind-like (inline & abbreviated)? I personally like the normal key-value & scoped styling. But it seems that tool like styled-components is an anti-pattern to Fresh....

Passing C enum to function and read in TypeScript

First of all I am not a trained software developper, so please forgive me if I am missing some basics. I am trying to build a wrapper around a dynamic library to IEC 61850 communication.
On the the exposed functions of that library is IedConnection_connect(..., IedClientError error, ...) , where IedClientError is a enum with 23 entries. To be able to use the library I need to ...

intergrating Flowbite with fresh

I want to intergrate Flowbite with Fresh. Any idea on the best way to go about this? And will I be losing anything in terms of speed if i use Flowbite?

get file path from FsFile

given a Deno.FsFile, is there a way to get its path (or at least a filename)? i can't really see a way to do that judging by the typings e.g. ```ts...

bulr to rtransparent gradient

I am working on reactjs project in the project it should have blur to transperant bg take a look at the screen shot blur was bit sharp that was not good to see suggest me a help then i will share my code
No description

Streaming video from browser to deno server

Trying to stream video from Chrome to my local Deno server but having trouble understanding how to pipe things up correctly. When I visit localhost:8000, which hits the /video endpont via the <video> element, the /receive endpoint throws this error: ```js...

Migrating from Deno.run to Deno.command, how to readLines?

At the moment I have this: ```ts const command = new Deno.command('...'); for await (const line of readLines(command.stderr!)) { // ......

How to abstract tests to allow running different functions against the same test suite?

I've set up two suites of tests like this: https://github.com/gustwindjs/gustwind/tree/develop/htmlisp/html-tests, https://github.com/gustwindjs/gustwind/tree/develop/htmlisp/html-tests-sync . They are effectively the same but one is for async code and one for sync. Due to how the language works, technically it should be possible to use the async test suite for testing the sync code since await just wraps sync result within a Promise. The question is, what would be a sane way to extract the...

Fresh tabler icon class

Hello I want to use the fresh tabler icon lib without using the npm version like this: ```ts {...

Redirection in Testing is Always Valued False

This is my first test in full stack framework, especially for Fresh. I'm not sure why the redirected is always false in testing, while if I see in the devtools it's marked as redirect. Is there anything that missed?
No description

Neovim setup with LSP formatting & linting

hello, I am trying to set up the fmt & linting using nvim-lspconfig with neovim Anyone know how i set it so that I format using the deno.json file? here is a link to my dotfiles...

block js with #[op2] fn without blocking rust thread

I'm using deno_core and I'm looking for a way to block the js main thread without using a sync function to block rust's thread. ```rust #[op2(async)] #[string] async fn op_sleep() -> Result<(), AnyError> { // should not block rust thread tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;...

Connect to managed databases from "INSIDE" of Deno Deploy

Hi I am trying to connect to a managed database from INSIDE another application in deno Deploy. But I have this error : ✖ Deployment failed. error: The deployment failed: UNCAUGHT_EXCEPTION TypeError: Non-default databases are not supported...

Buffer.from equivalent in deno?

on node.js ```js const signerPvtKey = Buffer.from( // process.env.PVT_KEY PVT_KEY,...