Deno

D

Deno

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

Join

Streaming large files with fetch and FormData

Hi, I'm trying to find a way to build multiplart/form-data requests in Deno that contain large files. Ideally, I'll like these requests and the underlying files to be streamed out instead of needing to read the whole file into memory and adding them as parts to the request. I can't seem to find a built-in API for acquiring a Blob-like file handle. I also tried using npm:fetch-blob/from.js but that isn't compatible with Deno. Compared to other platforms: Node.js v20+: the fs.openAsBlob function in node:fs can return a web File backed by the file system Bun: The Bun.file function also returns a web File backed by the file system ...

If I want to integrate a fully featured Deno runtime into my application, where do I start?

I want to create a scripting environment for my application that will enable people to create custom integrations/workflows. I'm investigating if I can use Deno for this use case, but if we present it as an embedded Deno runtime to our users, I think they will also expect compatibility with all the things Deno offers as well. That means TypeScript compatibility, NPM compatibility on par with Deno's, being able to import from URLs, etc.. From my understanding a lot of that logic is implemented in...

Trying to deploy a project on Deno Deploy with a private Github repository dependency

By reading the docs at https://docs.deno.com/runtime/manual/basics/modules/private I found that I can have a environment variable called DENO_DEPLOYTOKENS. This works perfectly locally and in Github Actions but in Deno Deploy I can't create environment variables starting with DENO, it's reserved. Any ideas? Thank you.

How can I make sure the code gets run on the client-side??!

```tsx import { useEffect, useState } from "preact/hooks"; export default function Callback() { useEffect(() => {...
No description

VSCode + Deno + Vite + Typescript

Just setup a project with create-vite-extra but all the starter files are full of typescript errors -- including all jsx. I did some research but can't find any clear answers. How can I get all these tools to play nicely?

Memory Limit

Hello guys, in some situations i'am receiving one of the following error message dd-hard-memory-limit:deno or dd-soft-memory-limit:deno, what are those limits, and how can i track them?

Google Calendar

Hi! I am looking for a minimal example how to access google calendar API. I already obtained credentials.json form Google, just would like to have a minimal "hello world" of Google calendars. Like list all of my calendars. ...

I can't access my deno cloud github account

Please help, by mistake I converted my personal github account to an organization account, and now I cannot access my projects that I had within deno cloud and I cannot make changes to my projects that are in production, which is a web application and backend application. Please support me I need to access my deno cloud account.

Uploaded a module, need help!

I uploaded my module: https://deno.land/x/vipps_mobilepay_sdk@0.0.1 But then I realised that I should have pointed it at my src folder, not the root folder πŸ€¦β€β™‚οΈ I tried updating my Github webhook from: https://api.deno.land/webhook/gh/vipps_mobilepay_sdk to:...

Better way of finding element from map

Im making an api and all routes are stored in a map. is there a better and more optimised way to look if the route exists and to get it? ```ts handleRequest(req: Request, info: Deno.ServeHandlerInfo): Response { const path = new URL(req.url).pathname; const route = this.getRoute(path);...

deno info depth

how do i limit maximum output depth for deno info command? for example, it's easier to analyze very complex dependencies when maximum depth is specified.
No description

Date library

Can anyone recommend a decent working date library for deno? All the ones I'm trying (datefns, dayjs) are giving me errors or are not giving me types (no ctrl-click on symbols) in VS Code.

await writer.write(buffer) never resolves on Deno.Command

Hiho. I'm creating a Deno.Command that writes a buffer to vipsthumbnail via stdin (and reads the result via stdout). It works most of the time, but sometimes gets stuck on await writer.write(source);. Source is the result of await Deno.readFile(path). The big problem is that there is no error, the writer.write() promise is just never resolved. So I have no idea how to debug, catch errors or even cancel this after timeout or something. ...

Not sure if I understand kv watch right?

Not sure if I understand kv watch right, is like named queues? o more like a reliable Broadcast channel?

Displaying a Modal

I am trying to get a minimal example of using Bootstrap Modals, and managing that modal using state. Here is routes/Index.tsx: ```...

How do I run an npm script with multiple dependencies, e.g. `drizzle-kit generate:pg`?

I thought about wrapping it into a task "generate": "deno run -A npm:drizzle-kit generate:pg" in the deno.json file, but I'm getting
Task generate deno run -A npm:drizzle-kit generate:pg
error: Uncaught Error: Cannot find module 'drizzle-orm/pg-core'
Task generate deno run -A npm:drizzle-kit generate:pg
error: Uncaught Error: Cannot find module 'drizzle-orm/pg-core'
in that case...

How to use a class name as a qualifier for an enum ?

Hi there, it's more of a generic typescript question but I'm using it in the Deno context and the linter throws some warnings at my code. I'm trying to do this little helper class for rich text logging in the terminal : ```ts export class RichText { // deno-lint-ignore no-explicit-any...

how can I make him see the process?

error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'on')
process.on('unhandledRejection', (reason) => {
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'on')
process.on('unhandledRejection', (reason) => {
...

Importing NPM Packages in Deno Throws 'Uncaught SyntaxError' for Specific Modules

Hi there, I'm relatively new to Deno. I'm running into an error with an NPM package import. ```JS import { BskyAgent } from "npm:@atproto/api"; const agent = new BskyAgent({...

How to override type definitions provided by a third party module

@Deno AI Helper How do I override type definitions provided by a third party module