Deno

D

Deno

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

Join

Pass string from TS to dll and return the passed string. (Like echo)

Hey I am currently trying to understand the communication between a dll and my TS program. Currently I am simply trying to pass a string to the dll and have the dll give me the string back. Similar to an echo. I have been trying to follow this guide for this: https://medium.com/deno-the-complete-reference/calling-c-functions-from-windows-dll-in-deno-part-2-buffers-131226acd3d2 only somehow I can't pass the buffer in my TS program. Can someone give me a simple example of how to pass a string from TS to dll and from dll to TS? ```ts const dll = Deno.dlopen('./test.dll', { 'echo': {...

deno-deploy limits on file storage?

When deploying static files via deployctl, what are the storage limits / costs per GB? Couldn't find any reference to it.

Reading a ReadabeStream without consuming it?

Hi, I'm trying to migrate an HTTP/HTTPS proxy protocol server from Node.js to Deno. The proxy listens for TCP connections, and I need to handle HTTP and HTTPS connections differently, so the first think I do is to read the first byte of every new connection to determine if it starts with "22" (which means that it is a TLS handshake). ...

Does anyone have a working OpenCL deno example?

How can I use opencl with deno? Any examples?

absolute imports in fresh?

how do you get this accomplished?

PhpStorm not resolving local import with import_map.json

Deno Version : deno 1.33.0 (release, aarch64-apple-darwin) v8 11.4.183.1 typescript 5.0.3 ...

how to cancel test watch

on linux. ran deno test -A --watch tools/json_tools/examples/*.ts and ctrl+c does not seems to work. had to force-quit terminal to stop it....

Sentry DenoOsUptime is not a function issue

I'm using npm:@sentry/node@7.49.0 and the following script to test the integration ```TypeScript // sentry import and init here async function testEvent() { try {...

Property 'openKv' does not exist on type 'typeof Deno'. VSCode

Such as the title say, I cant get the LSP to recognize openKv in the Deno namespace... deno 1.32.5+78b630d (canary, x86_64-apple-darwin) v8 11.2.214.15 typescript 5.0.3...

Import from direct URL works fine, but NOT via deps.ts

``` // ./lib/foobar1.ts // everything is fine import { z } from "https://deno.land/x/zod@v3.21.4/mod.ts" const foobar = z.string()...

Small Deno Script to upload to my server not working due to not being able to be run on CentOS

All my clients run Ubuntu or Debian, and the script will not run on CentOS due to the problem of a GLIBC problem. I saw online you can run a docker container but I am majorly confused and not a coder in the slightest, I just need to solve this solution as soon as possible.
[root@atl-sql jasmeowsystems-uploader]# /root/.deno/bin/deno run -A index.js
/root/.deno/bin/deno: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /root/.deno/bin/deno)
[root@atl-sql jasmeowsystems-uploader]# /root/.deno/bin/deno run -A index.js
/root/.deno/bin/deno: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /root/.deno/bin/deno)
...

Empty output in Deno.Command

I’m trying to run the command git log —grep='.' from Deno. However, it always returns an empty output. If I delete the grep option it returns it fine. Running the same command from the CLI returns all commits. It’s weird because other “similarly looking options” seem to work fine for example —format....

How to display data from a Handler on every page?

Hi, I am having the problem, that the PageProps are not accessible in the _app.tsx and I have not figured out how to access PageProps in a component (in the /components folder). If I give a component the PageProps parameter, Deno complains that I am not giving an argument in the calling file. Can someone help me with that? It is probably something that is done all the time in a project. In the end I just want to get something with a handler from a server and then display it in a component but as I stated, I do not know how to access that because I want to display it on every page using the app-wrapper....

How do people bundle their Deno code for web?

I am currently using Deno bundle command to bundle my code for web. Is there a better alternative for bundling + type-checking folks are using? I can't find anything that looks robust and Deno-ish and ended up with a big hacky script (below). I love esbuild but it doesn't support type-checking and esbuild_deno_loader is still maturing. ``` import * as esbuild from 'https://deno.land/x/esbuild@v0.17.11/mod.js' import { denoPlugin } from 'https://deno.land/x/esbuild_deno_loader@0.6.0/mod.ts'...

Preventing `Deno.stdin` reads from blocking

In a module for reading Deno.stdin input, there is a loop that reads and parses the returned bytes. My issue is that, in case of an uncaught error/rejection, the process hangs until stdin has something to return, and once it does, only then does it exit the process and log the error information. Is there a way to make this read() non-blocking in that sense? If the user does not input anything, but an error occurs, the process should exit immediately and not have to wait for a keypress. The code below can be run from a file for demonstration....

Can I pre-cache dependencies that I specify using npm:?

Hi! Trying to figure out the right way to combine Deno's module support to make our deploys consistent. In particular, I was using esm.sh URLs, but just hit some CDN errors so that made me switch to npm: in hopes of it being more reliable. But afaict deno vendor doesn't vendor npm dependencies? What's the right combination of things to do to deploy reliably?

JSON Schema Core, $dynamicAnchor, and $vocabulary

Slightly off-topic, but I'm writing a Deno library. Anyone deeply knowledgeable on JSON Schema Core? I have this meta-schema, and I can't figure out how the heck it's supposed to work that "$ref": "meta/core" would refer to "https://json-schema.org/draft/2020-12/vocab/core" – any ideas? I feel like I'm missing something fundamental knowledge on the JSON Schema Core spec here... ```json...

Test case is leaking resources

Hi, all my tests keeps failing because of ``json error: AssertionError: Test case is leaking 2 resources: - A timer (rid 770) was started before the test started, but was fired/cleared during the test. Do not close resources in a test that were not created during that test. - A timer (rid 773) was started during the test, but not fired/cleared during the test. Clear the timer by calling clearInterval or clearTimeout`....

[have workaround] "deno" and "deno repl" aren't producing output

I typed in "deno" and nothing happened, and I thought it was finally doing the right thing when no arguments are given to a scripting language command, which is to accept input on stdin, but it seems to just be a glitch. Any idea why it's hanging for me when I type deno or deno repl? It works when I do deno run hello.js and deno help. deno --verbose isn't a thing....

Serve Fresh over HTTPS locally

How can I serve Fresh over HTTPS locally? In node I might generate certs and do ``` https.createServer({ key: fs.readFileSync(path.join(__dirname, '..', 'certs/localhost.key'), 'utf8').toString(),...