Deno

D

Deno

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

Join

deno_core run files concurrently

Is is possible to run multiple files concurrently using the deno_core crate?

preact form not working?

hi all, i'm just trying to make a simple form but for some reason it keeps submitting the form as if there's no onSubmit function... inputbar.jsx ```jsx /** @jsx h */...

deno.lock multiple entry point best practices

Hi, I just upgraded to 1.28.0 and realized that lock files are here by default for deno.json config projects. I figure that means its time I adopted lock files. So I wanted to open a forum about best practices. I have read this doc https://deno.land/manual@v1.28.0/basics/modules/integrity_checking, which is a good start. I know at least that a lock file should be checked into git (which is less confusing than w/ node, where lock files change per OS and their advice on version control is pretty fuzzy. Here is my remaining question though, what happens when I have multiple entrypoints? Specifically, I am looking at this repo I own https://github.com/andykais/sqlite-native. I have three main module entrypoints: 1. src/mod.ts (this is what lib users will use) 2. test/*.ts (this is for running tests)...

Arrow keys don't work when using cli on windows

I've tried to create a new vite project but I'm not able to select the template I want because the arrow keys don't work.

About performance

if a function takes only one paramater and i pass unnecessary additional parameters would it affect the performance of just the function part of the code? ```js function echo(sentence) { console.log(sentence)...

deno_core Extension with Global Access

Is there a way to make a Deno Extension be accessed by Extension.op() instead of Deno.core.ops.op()?

How to stop reading from a ReadableStream?

```js let user for await (const data of readable) { if (data.user.id === 'user-id') {...

Multi arch docker image based on alpine

Is there any multi arch docker image for deno which includes arm? Preferably built on alpine....

Deno.inspect, how to log class instances with getters

im trying to log a class instance that has getters in it, with Deno.inspect ```ts Deno.inspect(client, { colors: true,...

how to ssr preact (without fresh)

i tried with preact render to string but it wouldnt ship any js

Synchronous read single line from Deno.stdin

Hi, how would I go about reading a single line from Deno.stdin synchronously?

How can I enable type checks while running fresh

I want to relay on the code being type checked and yelling at me when I made a mistake, but deno task start in a fresh project doesn't seem to care by default. Is there some config I can change or at least some other script I can run in parallel to check the types? (I also observed that VSCode plugin seems to indicate more type related errors than my Jetbrains IDE, does somebody know why?)...

axios gives me a CORS error, fetch doesn't. Why is that?

NODE ```ts import axios from 'axios'; let res = await axios('https://example-29544e.webflow.io').catch((err) => { console.error(err);...

securing access for deno deploy?

We are creating a page using fresh, that is only for internal usage inside our company. We would of course love to use deno deploy for it, but is there a good way to limit the access to both the rendered frontend and the API, maybe even with something similar to cloudflare access? We are currently looking into a way to add a custom middleware, butaybe there are simpler solutions, or even alternative ways of hosting the page (without going through tons of infrastructure setup)?...

Learning how this works under the hood

Recommended resources to learn how this stuff works that can be understood by a dummy without a background in computer science? For a guy like me, becoming proficient at coding amounted to more or less like learning what goes with what and remembering how to get things to happen. I'm very limited by my lack of understanding how any of this (runtimes, bundlers, compilers, etc etc) works under the hood. I want to level up....

Closing a websocket server in a unit test

Hello, I'm an author of rpc lib and I'm currently writing unit tests for it. I am facing a problem of closing a server. How should I do it without deno hanging forever? my test case: ```js import { send, App } from './mod.ts'...

Error The deployment failed Module not found

Error The deployment failed: Module not found "npm:@coingecko/cryptoformat".
Link to module: https://www.npmjs.com/package/@coingecko/cryptoformat...

File name conventions

Some of my .ts files are meant to be run from the command line. Some of them when imported do things (like read .env files) Is there a file naming convention for such things?...

split error when using std toml

here's the error: ``` $ deno run -A toml.ts error: Uncaught (in promise) TypeError: subStr.split is not a function const lines = subStr.split("\n");...

How to cancel or abort .pipeTo()?

I prefer not asking, but after I found (what I consider) an MDN easter egg, I realized this is probably not something I'm going to solve without help from runtime-implementers. https://user-images.githubusercontent.com/17692058/200146738-da3e8747-6c7f-4ec7-adb8-fbb8c8947d33.png The example is straightforward, call stream1.pipeTo(stream2) then, with full access to both stream1 and stream2 try to shutdown/cancel/close/abort/sabotage/nuke stream1, stream2 or even just the pipe itself (copy-paste example below). The big issue is that, because of the pipeTo the deno process never ends. I've tried absolutely everything I can think of, including inheriting from WritableStream, prototype pollution hacks, accessing probably-shouldnt-be-accessed-directly-symbol keys, etc and I've not got a hint of success ```js...