Deno

D

Deno

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

Join

Confused by deno vendor-related behaviors

I created a main.ts containing this code:
import * as thrift from "npm:thrift";
let connection = thrift.createConnection("localhost", 9160);
import * as thrift from "npm:thrift";
let connection = thrift.createConnection("localhost", 9160);
...

How to release node:zlib resources

I have some testcases which use the node:zlib polyfill and I'm having a bit of trouble getting the tests to pass. Here's a very basic example: ```ts import { createDeflate } from 'node:zlib'; Deno.test('deflate teardown', async () => { const deflate = createDeflate();...

Deno Repl Programmatically

Python has a really nice not-well-known tool for creating a repl at any point in the code (kinda like a debugger but without any need for all the debugging setup). For example, ```py def somethin(): func = two_hour_long_computation_with_hard_to_serialze_output() try:...

Deno for SASS dependencies?

I'm trying to understand how I would migrate from Jekyll and NPM to Lume and Deno. Specifically, I used NPM to install some dependencies: ```json { "dependencies": {...

How can I send a number across a Deno.TcpConn as stream of bytes?

I need to send a number across a Deno.TcpConn as 4 bytes, so it can be read by a server as an int32.

Migrating `Deno.run` to `Deno.command` with `readlines`

I had the following: ```ts browserProcess = Deno.run({ cmd: buildArgs, // eg chrome exe path, then options...

Error: Not implemented: crypto.KeyObject.prototype.asymmetricKeyType

Hello. Im trying to create a RSA Keypair, using the node crypto.generateKeyPair function, but i get this error. Is there anything I can do to still use that API?

`Uncaught TypeError: encode is not a function` when using npm module `@kubernetes-client/node`

I'm trying to use a particular call in the npm module @kubernetes/client-node from deno, but I'm getting a TypeError, and I'm not sure how to debug it: ``` 0 berge@varmeskapet:~/deno/typeerror> deno run --allow-read --allow-env --allow-sys --allow-run main.ts error: Uncaught TypeError: encode is not a function at encodeStringifiedCustom (node:querystring:641:12)...

Linking to external code

if i want to link to external code, do i have to import it from https://deno.land?

Impossible to install Deno on Linux Ubuntu LTS (22.04) x86_64

Hello Context & Tech : Trying to install Deno on Linux Ubuntu LTS v22.04 on x86_64 architecture Problem : when trying to run
deno --version
deno --version
it says : " command 'deno' not found but can be installed with : snap install deno" -> I do not want to install anything with snap...

Get length of video (stream. m3u8)

In deno/typescript, how can i get the length of a specific video stream (m3u8)?

github account blocked error

i changed email my old account to another account and when i login to deno deploy with that account i get this error

npm:axios not returning anything

I'm trying to troubleshoot a problem with axios (the same snippet works fine on node). I'm calling axios.request , however, it doesn't return anything and doesn't throw any errors. The sequence only get's to print axios request, however, doesn't progress further....

extension method returning undefined for `text/plain`

Given the following: ```ts console.log( "text/plain",...

Serving multiple static files to an HTTP request

If a client sends a request for an array of static files names like so.
["component01.js", "component01.css", "component02.js", "component02.css"]
["component01.js", "component01.css", "component02.js", "component02.css"]
Using a Deno.serve server, is it possible to serve all files in response to that one request, instead of having the client request them one by one? Would I need something like HTTP/2 or HTTP/3? And if so, are any of those supported in Deno?...

Kv encodes integer as double

Anyone know why Deno.kv encodes an integer in a mutli-part key as a double?
const key = ["int", 3]
encodes to: [2,105,110,116,0,33,192,8,0,0,0,0,0,0]
const key = ["int", 3]
encodes to: [2,105,110,116,0,33,192,8,0,0,0,0,0,0]
...

Looking for caching API Responses

Hello there, I'm looking for a package/or examples to cache API responses for a fresh project which call a mongodb server. I already check Deno Cache API but it doesn't answer my problem. or I'm using it wrong way Thanks for your time 🙂...

Trying to pass parameters to runtime from rust

Hi, I'm launching a deno runtime from my project's code. I'm trying to pass some dynamic json variables to the runtime however I haven't been able to this. What's the best way to launch a runtime with a context?...

console.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 do the same thing, except there is a drop down to select which process's consoles to view, defaulted to showing all.
new Worker(URL.createObjectURL(new Blob(['console.log("yee")'], {type: 'text/javascript'})), {type: 'module'})
new Worker(URL.createObjectURL(new Blob(['console.log("yee")'], {type: 'text/javascript'})), {type: 'module'})
...