Deno

D

Deno

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

Join

How to use recent Tensorflow.JS? TF from deno.land/x/tensorflow@v0.21 appears to work, but it's old

I've only tried the TF package from deno.land/x/tensorflow@v0.21 with the readme page example. I'm hoping there are better options - read it as more recent and maintained ports of TF. Here's the output of my trial of using jsdelivr version in Deno: ```typescript
import * as tf from "https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@4.13.0/dist/tf.fesm.js"...

Deno KV equivalent of 'returning'

hello, in sqlite there is a way to get the new value set on an upsert like so insert into counters (name, counter) values (?, 0) on conflict (name) do update set counter = counter + 1 returning counter;...

Leaking resources from inbound HTTP connections in tests

Anyone have any ideas why I would be getting the following error. I'm using an oak server that is started before all the tests and closed after they all finish. `` error: Leaking resources: - An inbound HTTP connection (rid 7) was accepted before the test started, but was closed during the test. Do not close resources in a test that were not created during that test. - An inbound HTTP connection (rid 21) was accepted during the test, but not closed during the test. Close the inbound HTTP connection by calling httpConn.close()`....

Preact Hello World is not working

/** @jsxImportSource https://esm.sh/preact */ import { useState } from "https://esm.sh/preact/hooks"; export const A = () => { const [d] = useState(1);...

using imports map to map no-suffix imports to suffix imports

I was hoping i might be able to use an import map in my deno.json like this: ``` "imports": { "./supabase":"./supabase.ts" }...

docker-jupyter with deno?

Anyone know any good pre-made solutions? Thanks!

Importing JSON files with a different file extension fails as "Unknown module"

When trying to import a json file with import attributes that doesn't end with .json Deno gives the following error:
error: Expected a Json module, but identified a Unknown module.
Specifier: file:///C:/path/to/jsonfile.ldtk
error: Expected a Json module, but identified a Unknown module.
Specifier: file:///C:/path/to/jsonfile.ldtk
...

BroadcastChannel vs EventSource vs WebSocket

Why would one uses BroadcastChannel, over EventSource, or WebSocket? Could anyone provide clear examples, advantages, and inconvenient of them? Are they all available on Deno Deploy?...

Really Excited About Dino Jupyter

I tried to install the Kernel on Windows SANS - WSL. Here is the output: deno jupyter --unstable...

Trying to benchmark `Deno.remove` but it fails

``` deno bench --allow-write bench.ts Check file:///C:/Users/babak/OneDrive/Desktop/deno-benchmark-345654/bench.ts cpu: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz runtime: deno 1.36.4 (x86_64-pc-windows-msvc)...

Plot Vega-Lite in Jupyter Notebook running the Deno kernel

Hello, I am very new to Deno... I wanted to see if I can produce some interactive Vega visualizaiton in a Jupyter notebook, however I don't get any plot showing. Here is an example (taken from here): ```js import vl from "npm:vega-lite-api" import vlData from 'npm:vega-datasets';...

Segfault when creating second rust MainWorker in program

Hello. Not sure if this is the place to ask since it seems to be a v8 issue (or perhaps an issue with the bindings), but I figured at least people here can point me in the right direction. I have a segfault issue after updating deno_runtime from 0.122.0 to 0.131.0 (deno_core 0.199.0 to 0.229.0). My program segfaults when starting a second worker after the first one has completed, and on a different thread....

How to uploading images from frontend to Deno.serve()

Hey, can someone please give me a vanilla code example on how to upload files from my frontend application to the server that uses Deno.serve(). I know how to upload the image in the frontend and send it to the Deno backend using a POST request, but how can I work with this image on the server side? Currently my backend is set up without any framework....

Deno Deploy JSON import

I'm using zod-i18n-map library for error translation, which requires an import for the library itself and an import for the translation file, like this: ` "imports": { "@zod-18n-map": "npm:zod-i18n-map", "@zod-18n-map/es": "npm:zod-i18n-map/locales/es/zod.json",...

Most efficient way to broadcast messages globally across main script and workers?

I basically want a simple message bus that is global to all my workers + the main script, without relying on any dependency. Is there something more efficient, maybe using MessageChannel, than using postMessage() in workers to send things to the main script and iterate through all workers in the main script to postMessage() again on each worker?...

What is the process for deploying a jupyter notebook made using deno?

I have webdev experience and was using Observable. I was looking for alternatives that use javascript and came across the Deno/Jupyter Notebook combination. There is a lot of information about converting to html or deploying notebooks from the perspective of a python dev, but I have no way of gauging if the process is the same when using deno. How does one deploy a notebook? Note: I am not interested in notable.io, though I am sure it's great for people who are interested in something like that. Also, not sure if the tag(s) I chose was right. Thank you!...

PostGraphile on Deno

Does PostGraphile work with Deno? Trying to see if I can run PostGraphile as a serverless function on Deno Land.