Deno

D

Deno

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

Join

Import SCSS in TS files

Hey, I am currently building a template for web development and I want to use ESBuild as a bundler. I use lit in combination with SASS. For SASS files I use the esbuild-sass-plugin from npm in Deno. This works fine and ESBuild successfully resolves and bundles the .scss files imported into the .ts files. However deno-ts marks the default import as red because it is not valid js/ts how can I specify this in the config for Deno so that the files get recognized as SCSS files/plain text? ```ts import style from „style.scss“ // ^ Works but is red because style.scss does not have a default export....

How to modify HTTP cache folder

Hello, I'm using Astro framework with Deno and Directus, but after a while of the website running on my server, I get a deno_cache folder very big, weighting more than 10 Go. My server has a specific folder where it's allowed to have big folders but I need to change it instead of using the default folder Deno is using. From what I've seen in Deno code it's hardwritten here but I'm unsure, I do not know rust at all and just followed how the variable is used....

Deno deployment can't connect to the Mongo Cloud, due to the Mongo Cloud Network Access Rules.

Is there a way to add the Deno Deploy IP to Mongo Cloud? The Deno Depoy Regions only region names found, but no ips https://docs.deno.com/deploy/manual/regions...

Is there a way to pull a module from x in favour of jsr?

I have ported my module @vicary/fresh-graphql to JSR and I would like to redirect my users go JSR instead of the unmaintained version in x. Is there a way to do that?...

In-Source Testing with deno test?

Can I do something like vitest's In-Source Testing with deno test? That is, I don't want to export private functions or objects just for testing.

How to use vendoring with node_modules

As trying to recreate a DENO_DIR via deno cache creates different results on different machines, I have to assume that the lockfile is not enough. So I wanted to try to vendor instead, so I set "vendor": true in my deno.jsonc and ran a single build, which creates a vendor and a node_modules folder. Even though I copied both, the vendor and node_modules to my git repository, the remote (airgapped) builder fails like this: ```...

Make an image cropper that crops from data uri

How to make an image cropper that crops to the given dimensions

Best practice for releasing a deno package on GitHub

Is there a best practice for the release process of a Deno library on GitHub? I use semantic-release for node libraries. Automating the release & (publishing to jsr.io) can still be quite helpful for libraries....

deno oak : howto force reply immediatly, and process the request later ?

Bonjour, My server needs to reply an ACK (200 OK) for each request. If it did not, the client dies. 😱 After the ACK reply, I try my best to process the request. Sometimes it works, sometimes it fails. We don't care. ```typescript...

TailwindCSS: Class-Strings build with variables

Since TailwindCSS does not support classes with variables (like I used before with twind), how would you color 10 elements with a Tailwind class but the color is retrieved from a list? For example: dark:bg-${color}-200 but the color is different for every button. I would use much more classes like text-color etc. so it was the easiest to do it with a variable that changes with every element....

Import path autocomplete doesn't work

Hi 👋 It behaves like it's just a string and not an import path. I have the latest version of Deno and Extension installed....

Deno: How to import npm scoped packages with @ in deno?

I am trying to import @whiskeysockets/baileys in deno like this: import * as a from "npm:@whiskeysockets/baileys"; console.log(a); ...

To avoide tariling slash in URL on deno deploy

We have used deno deploy to build website done using Astro frame work (Astrowind Theme)in production environment, It's observed a trailing slashed at the end of each URL when click on the menu but its found displayed correctly when hover the mouse on each menu . It works as expected without the trailing slash in my local environment. We have made all the changes in config files as per Astro documentation. could you please let us know if this happens during the deno deploy process ....

Importing internal modules

I would like to use https://github.com/denoland/deno/blob/main/ext/console/01_console.js in my code, but it can't be directly imported from ext: because i'm writing a normal program and not working on the deno cli itself :P Do i just have to vendor and patch it? I'd really rather not.

Strange error after lint in github actions

for a some reason after:
- name: Run linter
run: deno lint
- name: Run linter
run: deno lint
...

How to encrypt and decrypt files from S3 without loading the hole content into memory?

How to encrypt and decrypt files from S3 without loading the hole content into memory? I have this basic example (example in comments), I wonder is some of this can be used....

Worksapces / Monorepo support

Deno does not currently have the capability to resolve workspace:^ references and this breaks any monorepo setups that rely on it.

Deno Oak : Can't connect to SSE with Deno Deploy

Hello, I'm trying to deploy an app who use Server Sent Events. The goal is to keep in memory differents rooms and users when connected. Actually, i can see rooms being created and users being connected. I store the data of the room in a service but when i try to dispatchMessage on my users to send data, i see in my logs : user.target.dispatchMessage is not a function ...
No description

Error connecting to mongoose when using deno cli

deno-x86_64-pc-windows-msvc v1.41.1 Testing the following code using nodejs and on deno deploy works correctly: ```js import express from 'express';...