Deno

D

Deno

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

Join

What is the correct syntax to set the `compilerOptions.types` to use npm @types library

For example: As of now if I want my .ts files to have access to the npm:express packages @types/express I need to always reference in each file // @deno-types="npm:@types/express"...

Using "imports" in deno.json doesn't work in VS.code

* deno 1.38.3 * vs.code 1.84.2 * denoland.vscode-deno 3.28.0 I got rid of my import map and moved the "imports" directly into deno.json, as supported since 1.30.0....

deno repl start time in container

Why does deno repl take a couple seconds to start in a container the second time around, and starts nearly instantaneously the second time around in the host system? It's on OS X with colima (deno is running on x86) FWIW.

How to detect when --watch flag has been passed to `deno run` programatically?

I am writing a small cli script, and I have a few bits of code that do not play nicely with deno run --watch <script>. (e.g. Deno.addSignalListener('SIGINT', graceful_shutdown). What I want to do is only set up that listener when I am running my cli app in 'production mode'. E.g. while I am developing the cli app with --watch I do not want to set up shutdown listeners. Is there a way to accomplish this with the Deno global perhaps? My current workaround is to pass some custom flag to my...

Help with npm peerDependencies

Hi 👋 I am using an npm library that has @sinclair/typebox listed under peerDependencies. It gives the following runtime error whenever I import/use the library: ...

AWS Lambda config

How do i set permissions in deno for aws lambda. Like --allow-env etc

Migrating from EventEmitter


Hi! I've got some legacy code that depends on node:events 's EventEmitter class, specifically its once() method that returns a promise resolving the next time a specific event arrives, as well as removeAllListeners(). What would you suggest I use to get rid of that dependency? I can't use EventTarget since it doesn't let you drop all the registered listeners and doesn't support the once() scenario. Anything else?

using flexsearch

so flexsearch has a index.d.ts thats broken and hasn't been touched in 2ish years and instead you should use @types/flexsearch but i have no idea on how to override deps so i can use the Document interface

Help using DenoMailer

i'm trying to use it but i get Deno is not defined when i try to send the email, any tips? how would you approach it? ``` import { SMTPClient } from "https://deno.land/x/denomailer@1.6.0/mod.ts"; import { IRelatoForm } from "../../types/index.ts";...
No description

Debug all tests in VSCode

Hi everyone. I was hoping to use the equivalent of "deno test" in such a way that I can set a breakpoint in VSCode and run all test with debug. The effect would be that hitting any breakpoint in any test pauses at that line of execution. Is this possible?...

Most complete Deno Rust runtime?

I’m trying to embed the Deno runtime into my Rust program. I’m looking for the most “complete” Deno runtime with TS transpilation, basic ops (fetch/console/fs/etc), imports, and most of the things a basic TS runtime would have. So far I only found: - deno_core and https://deno.com/blog/roll-your-own-javascript-runtime-pt2: too much boilerplate - deno_runtime: no TS support...

How to write a new project template script

Hey, I've written a small game engine to create text adventures in Deno. The resulting project is a static web site—just a few little files—which can then be uploaded to itch.io or some other static web-based game server. What would make this easier is a script of some kind that would generate new projects from a template. Currently, Vite uses a script that asks the user a few questions on the command line and generates a new project from GitHub. Is there an idomatic way to do this with Deno? If I write a new project script like this, is there a way to upload it so other users can create games the same way?...

Seamlessly include Tailwindcss

Is there a recommended way of achieving this at the moment? What is the cleneast way of including tailwindcss with postcss in a Deno project while having autocomplete for the development?...

tidy up `deno.lock`

Hey, is there something like go mod tidy (https://golangbyexample.com/go-mod-tidy/) in Deno? The background is that my deno.lock got a couple of entries that I no longer use and so I was wondering what the "most convinient" way it would be to get rid of those entries. Thanks in advance!

SyntaxError on Web3 package

I'm trying to use this module in my project https://deno.land/x/web3@v0.11.1 and i'm using the code from the examples in my Supabase project, like import Web3 from 'https://deno.land/x/web3@v0.11.1/mod.ts' const providerURL = Deno.args[0]...

how to document oak api

What’s the best way to document an oak api. Like swagger or some kind of that

web based cms

Is there any web based cms system like word press based on deno or fresh?

Minimal code for Preact SSR

What's the actual code to do some Preact SSR with Deno? For example something simple like a counter that is incremented by 1 each seconds. Ideally something that could run on a Deno Deploy Playground without any deno.json...