Deno

D

Deno

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

Join

When to use deno add compared to import with a prefix?

As the title says, I can import like this:
import { parse } from "jsr:@std/csv/parse";
import { parse } from "jsr:@std/csv/parse";
...

on deno fresh or other deno frontend it takes at least 6 seconds for changes in the code to show up

whenever I change a component, layout, text etc it takes a lot more time to show up in localhost than when I use npm. Am I missing some obvious thing to do or this is just how it works? >.>...

deno+vite+tailwind

https://github.com/bpmooch/deno-vite-template I am having issues using tailwind with a deno+vite template. I created a github repository with a small reproduction of the issue. make will run deno run -A --node-modules-dir npm:vite. I get an error when running that command, complaining about the vite.config.ts. Has anyone gotten deno + vite + tailwind working?...

Is there any deno2+vue3 sample project?

Excuse me, is there a sample project for deno and vue as I won't be able to configure it after switching over, so thought I'd ask for help, thanks a lot!

The requested module 'npm:@jest/globals' does not provide an export named 'describe'

I am doing some exercies on exercism in the Typescript track, but I want to run my solutions locally on my machine using deno. So I have a folder, and in it I have two files (two-fer.ts and two-fer.test.ts): ...

NotSupported: LocalStorage is not supported in this context.

I get the above error when trying access the localStorage API from my compiled .exe. I'm using the exact same compile parameters I have saved in a VS Code task before, which used to work.

How to obfuscate project before compile it ?

Hello, is it possible to obfuscate the code before compile it ? The code is still visible if you open the exe file with notepad/vscode...

Bundling node-tree-sitter

Hello there! I'm working on a language server written in Deno TS. I'd like to bundle it with node-tree-sitter, and I'm using esbuild as the docs recommend., but node-tree-sitter doesn't bundle nicely. https://github.com/bennypowers/design-tokens-language-server/issues/1#issuecomment-2776935304 If you have some ideas how I might work around this, I'd appreciate your input. Maybe with a dynamic import and --include?...

How to load fonts in /static?

Using Fresh with tailwind By doing ```css @font-face {...

How do i correctly create local package/package.json - that can be used by locally running deno app?

The tl;dr is that I have a sveltekit app and a deno app, and they both share code. Everything seems to work on the CLI level, but I cannot get it to work on the LSP level (vscode) I think? I can't tell if it's my lack of understanding of how deno expects imported npm packages that are local - or if that's even possible, or something else. I have put up a mock repo to show what I am trying to do, and I also creted an issue in github that shows some fix attempts that lead to extremem performance degredation from the deno lang server (i think at least) I'm trying to figure out how to structure a node package and what the package.json should look like in order to correctly be able to reference this package from a deno app using an import_map...

Install package provided from URL as `.tar.gz`

Some sites like https://github.com/stackblitz-labs/pkg.pr.new provide packages as tarballs. How can these be installed in a deno project? With npm, we can simply run npm i https://pkg.pr.new/<owner>/<repo>/<npm-package-name>@<pr-id> and the PR branch version of the package will be installed. Does deno have a way of handling this?...

Importing Tesseract.js

Hello! I am hoping to use tesseract.js to do OCR in my application. However on deno 2.2.6, when I try ``` Tesseract.recognize( 'https://tesseract.projectnaptha.com/img/eng_bw.png',...

How do I compute a cursor for kv.list?

I basically I want to list entries after a known key. I'm trying to implement this function: function getEvents(afterEventId: string) { const entries = db.list({ prefix: ["events"] }, { cursor: ??? } ...

deno.json glob exports

I am using a monorepo with multiple projects. I would like to use specific files from package @namespace/toolbox in package @namespace/project. In package toolbox, I have the following deno.jsonc: ```json...

Socket failing to transmit/receive when using 'upgrade' event and socket.write on Expressjs server

Hi, I'm using the ws npm module with my Express server (lots of routes were imported from a different project, one using Node with express in mind). Use of either socket.end or socket.write hangs the request. The event listener is attached to the Server given by app.listen(). The script with this bug commented out is here (ctrl+f for 'upgrade'): https://gitea.proxnet.dev/zombieb/galvanic-corrosion/src/branch/master/src/main.ts...

Cannot use daisyui as a tailwind plugin

Hi, when trying to add a component library to a completely new deno install I came across a problem. I added screenshots to show the problem...
No description

Selective package.json Discovery in Monorepos

Hey Deno community! 👋 I'm working with a monorepo that contains both Deno-compatible shared libraries and non-Deno projects (like Expo/React Native). I've run into an issue where Deno discovers and tries to install dependencies from ALL package.json files in the workspace: ``` DEBUG RS - deno_config::workspace::discovery:278 - package.json file found at '/path/to/monorepo/package.json' ...

Express and WebSocket server on one port

Hi, I'm using Expressjs in my application. I need to handle websockets and the Express routes on one port. I know this can easily be done with Node, but how can I do it on Deno? I can't switch away from Express, but I can start from scratch with any websocket library. I'm using app.listen(port) in my code....

Running deno add npm:xxx via docker results in not found

So, in an experiment to run most things via docker to isolate stuff on my system I'm trying to run Deno via docker. I have a very simple shell script file, /opt/bin/deno like this: ``` #!/bin/sh ...

Check dependencies version

Hi I am new to Deno. I mostly work in highly regulated industries, so part of my development and maintenance workflow is to frequently and automatically check if any dependencies are out of date....