Deno

D

Deno

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

Join

How to get remote IP address when using Deno.serve?

I'm using connInfo when using Deno from STD but the native http server doesn't seem to have such interface, since it's undefined via the handler.

Two questions on documentation

RTFM in 3... 2... 🙂 Question 1: How do i hide documentation for specific exports, i do not want to document exports of dependencies, like https://deno.land/x/entsoe_api_client@0.5.1/deps.ts . I tried /** @ignore */ to no avail...

Is there any simple way to keep track of the heap/stack usage of a running Deno application?

I have made a Deno application and I'm curious to know if there's heap/stack issues that I should fix. I use a lot of promises with some recursion.

Deno-lint shows an error on the event type. (which shouldn't be)

Here is the full thread about it: https://discord.com/channels/684898665143206084/1050387276322058311 I use JSX.TargetedEvent<HTMLInputElement, Event> as the type of event. It works perfectly when I run it, but deno-lint still give me this error when I use event.key : Property 'key' does not exist on type 'TargetedEvent<HTMLInputElement, Event>'. Is there anyway to fix it?...

using data from one deno bench in another

is there any good way to re-use the results generated in one deno bench in another one? example: ```ts...

docker compose up of Oak server throws: SyntaxError: Duplicate export of 'type'

I am just learning how to use Docker, and am trying to put up a container of an Oak server. When running docker compose up, it throws the error mentioned above. This doesn't happen locally, or on Deno Deploy. I'm not really sure where to start? Can I somehow ignore this error, or is it actually a problem? ...

Publishing Deno Module with Bin (Answered)

I know there's a way to include a bin/ when publishing a module and then perform some kind of deno install https://module-url because I've used it before. But now that I'm searching for it, "bin", "executable", and the like only turn up docs on deno compile. I remeber there was an example installing curl.ts (https://deno.land/std@0.168.0/examples/curl.ts) but I can't seem to find that example either. Could someone point me in the right direction?

Use local tgz file instead of tgz from npm registry

Hello, Is it possible to reference a local tgz file inside a deno project (like calling npm install my-lib-1.0.0.tgz)? I'm working on the open source library https://github.com/dreamit-de/graphql-server/ on a PR to make it possible to use the library in Deno. I would like to test if a change is working so my idea was to create a tgz file with npm pack, add it to an example Deno project and see if it runs in Deno....

vscode LSP being a disgraceful little bitch

for no reason obvious to me, vscode and deno's lsp has been acting up lately. any ideas what could be the reason? i haven't done anything special that i'm aware of. ```` successfully cancelled request with ID: 3290 Unable to send result to client. client asked to cancel request 3314, but no such pending request exists, ignoring...

Is there a way to fetch() with headers, WITHOUT forcing header keys to lowercase?

Title. I'm trying to create an API wrapper for a service which uses "Incapsula" as their firewall or something like that. Issue is, when making a fetch() request through Deno, the request gets blocked, with the exact same required header and parameter structure as done through say a web browser (simple GET) or an API testing app. I noticed that the flushed HTTP headers are forced lowercase (which is good, in most cases), which I feel like is causing issues with this very specific API (specifically, only my Deno requests are blocked). ...

Setting up complex values for `Deno.bench` function runs

i'm currently exploring the bench tools in Deno and have come across a case where i can't seem to be able to implement. in the simplest case, let's say we wanted to compare two functions that mutate a given array, but that array is nontrivially large: ```ts...

How do I use std/log?

I'm trying to create a log file. I don't seem to be able to make it work tho. ```ts import { handlers, Logger } from "https://deno.land/std@0.175.0/log/mod.ts"; ...

op_ffi_cstr_read replacement now that deno.core.ops is gone?

The latest release removed Deno.core.ops, which a library of mine relied on to use op_ffi_cstr_read to read Deno.PointerValue into a string. Is there an alternative?

NPM Import results in Rust panic

Looking to import the Airgram NPM package because I don't want to write it from scratch at this moment. The single line of code I have reads as follows: import { Airgram } from "npm:airgram@5.0.0" Running with -- inspect results in:...

Any way to catch error coming from inside npm compat?

I am trying to find some way to catch this so I can do retry logic. rn the process just exits....

Deno fmt conflicting with Deno lint, when using IIFE

// before formating
((): void => { /* code */ })()
// before formating
((): void => { /* code */ })()
after formating with deno fmt, it adds an extra semicolon before the IIFE, but deno lint says Unnecessary semicolon. Remove the extra (and unnecessary) semi-colon deno-lint(no-extra-semi)...

prototype dot functions. How?

How would I go about creating dot function that can be chained at the end of a number in Deno? Example: (2).toUSD() // returns $2.00 ```ts...

Override npm import dep with import maps?

Is it possible for me change a depedency of an npm package by using import maps? Say I want to use a different websocket than the base npm package is using....

Republish a /x/ module from a deleted repo

Is it possible to publish an old module from a new repo? i'v deleted an old one and created a new repo with module's source.