Deno

D

Deno

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

Join

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.

How to get Deno to fmt on save with VSCode?

I have a deno.json file with some fmt options which works if run fromt the command line but not when saving in VSCode. The belowe settings are set { "deno.enable": true,...

write map to .ts file

how would i write a Map object to a .ts file?

Integrate Twin to Svelte+Vite+Deno as Fresh

Is there any way to integrate the use of Twind into the Stelte+Vite+Deno project as Fresh does? That is, to be able to use class="flex sm:justify-center items-center ..."...

can i render some pages as SPA and some as SSR in fresh?#fresh kanalına mesaj gönder

can i render some pages as SPA and some as SSR in fresh? #fresh kanalına mesaj gönder...

How can I let my program keep running even if it receives SIGINT?

I succeeded to write a program to handle SIGINT using Deno.addSignalListener("SIGINT", ...) API, but Deno always exits when it receives a SIGINT whether I put Deno.exit() inside the signal handler or not. [Edit: It was my mistake. Deno keeps running if a signal handler was registered.] I just want my program to reload the configuration file instead of terminating when it receives SIGINT. Is there any way to do it?

How to disable deno linter for whole project directory?

I'm using deno with mixed project folders, some use Vue and shouldn't be linted by deno. How do i disable it for the project folder?

How can I get `npm` in the path for Deno.run()?

I'm writing a script to automate a tedious npm task that I run frequently. When I use Deno.run() it says that it can't find the program (see the screenshot). How can I get the npm executable in the scope of the Deno process? I'm using: - Windows 10 - Deno v1.29.4...

error: The source code is invalid, as it does not match the expected hash in the lock file.

```bash ➜ deno task start Task start deno run -A --watch=static/,routes/ dev.ts Watcher Process started. The manifest has been generated for 3 routes and 1 islands....

Use Deno.run() to communicate with Arduino

Hey I'm trying to communicate via USB serial with my Arduino. My goal is to have the result I get via USB serial available as a variable in Deno. I tried to do the whole thing with Deno.run(). This is my Arduino main file: ```ino #define POTENTIOMETER_PIN_A A0...

Best place to host server side Deno App

I have a server side app I want to host in a specific region and I only want 1 instance of it running at a time, so deno deploy is not really right for this. Are there any other hosting services that are deno friendly?...

Morgan logger alternative in deno?

Hello 👋 What are you using to log http requests in your APIs? For example I'm using morgan in nodejs but I'm wondering what's the best alternative in deno that is actively maintained 🙂 Thanks in advance!

NPM Import missing types

Playing around with some deno code and testing a npm import, the original package has types (redaxios) although when I import it it's not showing any intellisence in VS Code

Update value by reference without duplicating the data

Im exploring the world of FFI, porting some C applications I have to TypeScript, with the help of Deno. Currently, I cannot think of an efficient way to update the value that a pointer is pointing to. For instance, in C I could do something like: ```c char *array = calloc(2, sizeof(char)); if (array == NULL) return 1; *(array) = "hello";...

how to hash very large files

We have deprecated the old std/hash code in favor of the crypto module, but I do not know what the standard approach to hashing something piecemeal looks like. The advice around the crypto digest generally looks like this: ```ts async function crypto_hash(filepath: string) { const file_buffer = await Deno.readFile(filepath) const hash_buffer = await crypto.subtle.digest('SHA-256', file_buffer)...

xstate - no types imported

import * as xstate from "https://deno.land/x/xstate@xstate@4.35.2/src/index.ts"; file is cached, yet no types (restarted language server ext.) any ideas?...

example of kysely running on deno deploy?

Deno Deploy awesomely can connect to postgres directly from the edge https://deno.com/blog/deploy-postgres-at-the-edge so I was hoping to use https://github.com/koskimas/kysely#deno Was trying to make it work like this: ``` import { Pool } from 'https://deno.land/x/pg@v0.6.1/mod.ts'...

[react] document is not defined

the following code returns document is not defined. i have no idea how i'd go about fixing this. the example uses next.js' dynamic() but i'm doing this in "plain" react. any ideas? thanks! ```ts import { NotionAPI } from "https://esm.sh/notion-client@6.15.6"; import { NotionRenderer } from "https://esm.sh/react-notion-x@6.15.7"; ...