Deno

D

Deno

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

Join

Is it possible to change a fresh.js project to build ahead-of-time

I cannot find the field to input the required command. Do I need to remake the project, or go into the github actions and change stuff there? Or am i just missing something obvious? Thank you in advance!:):deno_thankyou:
No description

A Question about Tailwind plugins in Fresh

Hi there! I recently found this plugin for Tailwind: https://github.com/jamiebuilds/tailwindcss-animate, which is supposed to help to define even more properties on the tailwind animations. For example
animate-hover delay-20
animate-hover delay-20
if I have understood everything correctly. However I have really struggled to import it. How would one go about importing this into a fresh fresh.js project. I'm using Fresh.1.5.2, Thanks in advance;)

Route redirect handlers

I tried using this code to redirect a route to another route. ``` export const handler: Handlers = { GET(_req: Request, _ctx: FreshContext) {...

[SOLVED] Unable to publish to JSR via gh action

I am using wasm to build a package, and I am using esbuild to compile the wasm & js into one js file, and I have added a .d.ts file to type the exported functions. when I run deno publish locally, it publishes just fine, yet in my github action, it claims there are slow types and gives "error[missing-explicit-return-type]: missing explicit return type in the public API" error, it only gives me this error for the funcitons I have declared in the .d.ts file.

Using Deno.KV twice

I want to use Deno.kv twice. One in local memory and 1 persistent in database shared across multiple instances. Is that a good idea? And to do that, should I open two instances of Deno.openKv() in my app?...

Indexing Items by Last Updated Time in Deno KV

Hello, I need some help with indexing in Deno KV. I have a list of threads, and each thread contains posts. When a post is added to a thread, I want to update the "last updated" timestamp for that thread. Additionally, I need to sort the threads by their "last updated" timestamp. I created a secondary index with the key space ['last_updated', lastUpdatedTime, threadId]. However, this approach results in duplicates because I can't remove the older "last updated" timestamps. My goal is to get a list of 200 unique threads, sorted by the "last updated" timestamp. How can I achieve this without getting duplicate entries for the same thread? Is there a way I can do this with secondary indexes?...

driving async ops in deno_core

What's the correct way to run a single tick of the event loop in deno_core? I'm using poll_event_loop, but the result is always pending (i.e. the timers created with core.queueUserTimer are never resolving). Is there something else I need to poll? If I use tokio.block_on(run_event_loop) it works correctly, but I only want to run a single tick. My code currently looks like this: ...

Deno / Zod / ts-zod-decorators

Hi guys - I'm trying to use ts-zod-decorators as a means of validating function arguments. The library provides two decorators Validate and ZodInput. You can see in this screen clip I provide my deno.json, my little convenience files that bring relevant Zod features together, and then my class, having the method that I want to apply validation to. I'm getting an error message of "Decorators are not valid here" when I try to apply the decorator to the function argument. ...
No description

temporal with fresh?

Is this possible or am I missing something? The example from the blog for deno 1.4 doesn’t work even with the flag

Debug test in visual studio & deno.jsonc

Hi, I want to debug a test in Visual studio (on Mac). Test can't launch because I use a deno.jsonc with comment inside (live // a comment) How can I manage this issue ? Where can I modify the command line to remove in addition the warning ?...
No description

is there a deno-fresh compatible json rpc 2.0 websocket package?

i need help finding an json-rpc 2.0 pacakge compatible with deno-fresh for both frontend and backend using websockets.

what rpc version is https://github.com/deno-libs/rpc?

is this repo comply with the jsonRpc 1.0 or 2.0 spec?

Deno write large file

How can I convert this node code to Deno ```js import fs from 'node:fs'; function* largeArrayGenerator() {...

Invalid protocol value while using websockets

When using discord.js with deno and i try logging my bot in it returns error: Uncaught (in promise) SyntaxError: Invalid protocol value. When trying to login using node it works fine my full logs: ```...

Removing cookie for basic logout

I seem to be losing my mind. My logout pathway used to work, but now no matter what method I use, the cookie remains and a) the cookie is never removed b) the user can't actually logout as a consequence ...

How to import enums from npm:typescript package?

The following code crashes because the enum is undefined at runtime.
import * as ts from "npm:typescript";
console.log(ts.ScriptTarget.ESNext);
import * as ts from "npm:typescript";
console.log(ts.ScriptTarget.ESNext);
...

type checking `.js` files using `d.ts` files

would it be possible to type check javascript files using d.ts files? ```js // add.js /// <reference types="./add.d.ts" /> const add = (a) => a + 1...

Which standard lib do I use?

I see the docs referencing https://deno.land/std/ But I thought JSR is the new shiny thing? And everythign is referencing jsr:@std. So which stnardard lib do I use?...

cannot execute: required file not found

Using termux Got this error after installation with
curl -fsSL https://deno.land/install.sh | sh
curl -fsSL https://deno.land/install.sh | sh
...