Deno

D

Deno

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

Join

Error when using readline.question()

I get this error with the following code ```ts import process from 'node:process' import readline from 'node:readline' ...

Do we need lockfiles if all our dependencies are hosted on https://deno.land/x?

When I make a new Deno config, a lockfile is generated automatically and I don't understand why. I'm only using deno.land dependencies, which I think are immutable, and no NPM dependencies. Lockfiles are unwanted noise in my Git history. Is there any benefit to having it?

jsx in deno

Hi, I have simple code that takes use of jsx. Based on deno docs, the jsx support should be ootb. Is there anything I need to add? The error I get:
'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.deno-ts(2686) (property) JSX.IntrinsicElements.img: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>...

Express pt2 tutorial links to itself

At the very start of the tutorial, it mentions that part 1 got up and running, but the link points to the very same page you are currently at https://deno.com/blog/build-api-express-typescript-pt2...

onboard is infinite

Seems like the onboarding process is broken and won't stop repeating itself You need to be a new member to experience it...

Deno mobile app?

Anyone has made a mobile app using deno? I was planning to use Fresh and https://capacitorjs.com/ to wrap my webapp as mobile app any ideas?

What is the best way to count values with Deno.Kv?

I want to show the total values in the database. It seems that the only way is with kv.list() and then iterate the values. Probably this is not very performant if I only want to count the results. I'd like to have something like this: ```js...

Does kv delete recursively?

For example, if I have entries with keys: ['users', 1], ['users', 2], will kv.delete(['users']) delete both of those entries?...

How do I send a simple text file to the printer?

Hello. I am looking for an example of how to send a simple text file tot eh printer in Deno. Is this possible?

Active Handles and Requests

I'm running into an issue with the excel4node NPM library, where after new'ing a Workbook, the program just hangs, like there is an open handle or request. With Node, I could run process._getActiveHandles() and process._getActiveRequests() to see what is active. Is there a way to find active handles and requests with Deno? ```typescript import excel from 'npm:excel4node@1.8.2' const workbook = new excel.Workbook()...

Oak, `ctx.assert`, and middleware

I thought that ctx.assert would somehow "carry along" the information about the asserted condition to the next middleware in the chain, but I can't seem to get that to work. Am I misunderstanding something here? I was thinking if I do something like this, I wouldn't have to to a null check in the last middleware, but I apparently do? ```ts...

Checking for circular module dependencies?

Hi, I’m wondering if there is some way to detect whether there are circular dependencies in a set of modules. Ideally, it might look something like this: ```js let detectCircularDependencies = fileNames => { … } ...

List of all deno.land packages?

Is there a list somewhere of all the deno.land packages on one page?

Safety measures (statically, not runtime) for libraries that require environment variables?

Suppose I have a Deno library which expects certain environment variables to have been configured, otherwise a crash will happen. Does anyone know of a good way to somehow ensure at "compile-time" that whatever Deno application is using the library has configured these environment variables?

Deno debugging failure: Argument 0 must be a buffer source

I have TWO Deno project with and cannot use the debugger with ONE of them. One project debugs fine, the other does not. I do not know where to start to mitigate the problem. I see this problem with VS Code fronting the debugger and by using chrome://inspect directly. First, the error message:...

VSCode "quick fix" for missing import doesn't use import map

When adding a missing import via option + Enter, it will suggest the full URL, despite that URL being in my import map. After accepting the suggestion, it'll suggest to change the import to use the value in the import map instead. Can this be configured to be one operation instead of two?

Testing my Oak `Application` end-to-end

I have an Oak application, and I'd like to test the main const app = new Application() configuration, making sure e.g. that all the routes are being found, etc. I've only been able to find createMockContext, etc., but I can't figure out how to make a "mock server request" that would be accepted by Application.handle basically?...

Adding methods to Oak's Context?

I am trying to figure out how to configure my Oak application/router so that my routes can do things like ctx.customMethod(), could someone point me in the right direction? I can only really find how to customize the State, but that would only let me do ctx.state.customMethod() – is that how you're supposed to do it instead of what I had in mind?

Clear cache modules

Hello guys, I would like to know how can I remove unnecessary modules from cache? I've run - deno cache --reload=npm: main.ts
- deno cache --reload main.ts ...

How does importing `node:https` work?

Basically, how does it work? Does the machine need to have a Node.js environment installed for this?