Deno

D

Deno

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

Join

I need more help understanding imports and relative paths for a module I am writing

I am diving into the world of Deno and I am trying to port an existing node CLI. If you are developing a library, you should instead prefer to use the deps.ts pattern discussed in Managing Dependencies. I have read much of the documentation. but still feel lost on what's required/best practice/quality of life. Maybe I have a lack of understanding elsewhere, but I have a hard time understanding if deps.ts is required for end users when running deno install myModule....

Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...

Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after another using Deno and typescript? Example: Multiple users wants to execute a resource heavy job by clicking a button on their dashboard, however to not lag the host, only one job should be executed at a time....

Launch tests with unstable flag inside VS Code

Hi there, I'm creating a module that uses FFI and Deno.dlopen and I wrote tests to validate some of the API calls, like this one : ```ts import { assertEquals } from "https://deno.land/std@0.198.0/assert/mod.ts"; import { get_version } from "./mod.ts";...

What is the difference between JS Map and JS Object?

I know that Map is hash table implementation for JS, but how does it differ from an object? With regards to how Python dictionaries work, there seems to be no difference.
const x = new Map();
x.set("foo", "bar");
const x = new Map();
x.set("foo", "bar");
...

Deno KV: Should I expect 'value too large' errors inserting a JSON file with kv.set?

I was trying out kv and quickly ran into something I found surprising; ```js let kv = await Deno.openKv('omg.db') ...

Deno language server stops working in VS Code

After some random time the language server stops working and I suddenly get code errors like this:
An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.deno-ts(2705)
An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.deno-ts(2705)
(Even when I use "deno.enablePaths": [ "src" ] in settings.json) Increasing "deno.documentPreloadLimit" (to something like 10000) just delays the problem a little bit. ...

Getting free disk space without using child_process.

Hello everyone! I would like to create a small CLI tool using Typescript and Deno. I would like to monitor the free disk space on several disks. How can I get the free disk space on a Linux machine without forking a separate process (like exec --> df and the like)? In addition, I would like to deno compile my little program later, so I am not sure if Node's gyp is an option then....

test --filter a step

Can I only run a certain step in the test?

fastwebsockets how to end client calls and avoid Error in websocket connection Unexpected EOF

What is the issue in this client code that causes the error? ```rust pub async fn connect() -> Result<FragmentCollector<Upgraded>> { let stream = TcpStream::connect("127.0.0.1:9001").await?; ...

deno compile --include argument

In deno compile, how can i include a whole directory instead of just a file? Also, is there a way to include a .env file, because for me, it doesnt work

`deno run` as a library

deno run does a lot of useful things behind the scenes, many of which are not exposed as a library, but are instead in the binayry-only crate. Thinkgs like npm-resolution, fetching & caching, etc. Is there some official or active community effort to make these components accessible in the form of a library?

Permissions with npm/node imports

I'm trying to run a command and it's like I need to add --allow-read permissions because of the node: imports. This is the error I see: ```...

BroadcastChannel

When using BroadcastChannel api, in the background does deno send the broadcast to every instance or only instance that shares the same channel ? For example if I have a million running websocket clients, each listening to a unique channel then I send a message to a specific channel name will all the million instances get the request but ignore it or only the one with the same channel name ?...

Is it possible to create a TCP server on Deno Deploy?

Is it possible to create a TCP server on Deno Deploy?

oak server can't accept requests from another server?

hi, I'm trying out deno with oak to make a simple server. I set up cors(x/cors), it accepts requests from the browser, but when I try to make a request from a another server, the fetch fails. ``` errno: -111, code: 'ECONNREFUSED',...

addEventListener for keydown in terminal via deno?

Is there something like addEventlistener("keydown") in deno, so i can capture terminal inputs?

Deno KV Type Error

When I run await (await kv.get<typeThing>(["example"])).id (the value is an object), it returns a type error because it is a maybe type thing.

How to improve seo ?

https://deno.land/x/blog My question is when you use tool like this that work with md, how can i do to improve my seo...

Hashbang with TS file (without .ts extension)

Hi y'all, I have a few convenience scripts written in Typescript for Deno that all have a wrapper script. I wanted to swap those for simple symplinks to the code, which in turn contains a Hashbang but hit a dead end, because deno seems to assume extensionless files are JS files. Is there a way to tell Deno in the comandline, that it is dealing with a typescript file? Or do I have to either use .ts for all my scripts or keep copying the same wrapper scripts again and again and again?

Astro + Deno - Remote Imports

First of all thanks a lot for the nice template, it looks great !! I followed the guide posted here https://deno.com/blog/astro-on-deno and now I'm trying to test the remote import feature https://deno.land/manual@v1.36.3/basics/modules#remote-import. Currently it only works in the astro.config.js file but once I want to use it on a page it wont work....