Deno

D

Deno

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

Join

Convert Sub hosting user code to commands

Hi ! I'm new on Deno. I built my project on Node.js, but it seems that Deno is more appropriate for what I want to do. I'm looking for a way to safely run user scripts to feed a command pattern on top. The idea is to do something similar to an online Robocode. ...

How to remove `.ts` extension form file name

how i can turn this
import { UsersServices } from "#services/users.services.ts"
import { UsersServices } from "#services/users.services.ts"
to this...

Workspace option inconsistency?

I don't know if I'm just missing something but my local computer (latest version of deno) and my github action can't seem to agree on if the config option for making a workspace is workspace or workspaces. when the option is workspaces: deno publish: recognizes the folder as a workspace, attempts to publish all packages npx jsr publish: detects workspaces, but ignores it ("The "workspaces" field was ignored. Use "workspace" instead."), attempts to find name, version and exports...

Deno + Puppeteer causing compiler issues.

I get an error that document cannot be found. It's asking if I am trying to change the library. but when running deno run -allow-all --unstable it works error: TS2584 [ERROR]: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. const rows = document.querySelectorAll(".review-history-table tbody tr"); ~~~~...

vscode npm import not recognizing all package contents

Deno itself seems to be importing the package and its contents just fine, but vscode only recognizes certain exports. In this case, the tensorflow function "tf.sequential" works when the program is run, but vscode is not recognizing it. Only two properties are recognized: tf.data and tf.version
No description

Mongoose Type Error

This is my mongodb connection code ```ts await mongoose.connect("mongodb://127.0.0.1:27017", { autoIndex: false, retryWrites: true,...

Can not resolve types from npm:identifier with peerDependency

can not resolve the types so no type support in vscode.
No description

How to use crypto generateKeyPairSync?

I'm trying to make generateKeyPairSync work, but it fails. The sample code at the bottom of https://docs.deno.com/api/node/crypto/~/generateKeyPairSync does not work on deno 1.44.4 (MacOS Sonoma 14.5 M2 chip). I get: ```sh error: Uncaught (in promise) Error: Not implemented: crypto.PrivateKeyObject.prototype.export...

Installation directory empty | Windows 10 | PowerShell installation using github guide

Good afternoon, I apologize if this was already covered, I doom scrolled through the posts but did not see anything similar to the issue I am having. As stated in the title, I am attempting to install deno on a Windows 10 machine by executing the irm command in powershell. I am running PS as administrator, I have also tried using winget on CMD and PS respectively (both with and without admin). Each time I do, I get the success message but I cannot execute any commands. Investigating the .deno/bin folder in C:\Users%MYNAME%.deno\bin it is empty. ...

Is there any way to force a Deno dependency to use a specific version of std?

We're having an issue were a dependency we are importing from npm with the npm: identifier is trying to use a node lib that only exisits up to std v0.177.0, specifically the tty lib. Our main std version is in 0.244.0 specified in our import_map.json file. Is there any way to specify this 3rd party dep to use the std version it requires to work?...

Share a data between multiple instances Deno Deploy

Hi, I want to share data between multiple instance. My first instance create a key. Others new instances have to get the original key from first instance....

invalid peer certificate: UnknownIssuer

I'm running two https localhost services on different ports, and used mkcert to install a local CA, and create certs for each service. One service attempts to fetch from the other, but it's failing with error trying to connect: invalid peer certificate: UnknownIssuer I've set DENO_TLS_CA_STORE=system....

DENO_FUTURE=1 / Deno 2 in deno subhosting

How do I run with DENO_FUTURE=1 or Deno 2 in deno subhosting?

Testing Deno cron locally?

Is there a way to test Deno cron jobs without pushing the Deno deploy? Like using the development server or something?

deno cache

Does Deno bind cached packages per project? say, a particular concrete location of deno.json. Or the cache is global across the user, and one package when cached, can be taken from cache by Deno for any project?

Cannot find module Error

Hello, can someone help me with the error Cannot find module 'https://deno.land/std@0.97.0/http/server.ts' or its corresponding type declarations. It works, so something is returned on the localhost page or in a get method, but can I fix this error somehow? ```import { serve } from "https://deno.land/std@0.97.0/http/server.ts";...

Deno loading NPM module oracledb .node files with incorrect architecture

Hi team, I'm working to get Deno using the oracledb NPM module locally, v6.5.1 (latest), and when initializing the library in "thick client mode", the module loader is incorrectly trying to load in the arm64 *.node files locally instead of the darwin-x86.node version, even though my terminal is configured to run in x86 mode with "env /usr/bin/arch -x86_64 /bin/zsh --login" which is how I got it working in NodeJS. NodeJS correctly pulls in the darwin-x86.node version, but I don't see any way to run Deno in x86-64 mode, even though my terminal is in that mode. Any ideas? Thanks!...
No description

`deno compile` offline [Solved]

- I've got a sandbox (the nix packaging system requires it) - I run deno compile a.js outside the sandbox. Works fine. - I copy $HOME/.cache/deno into the sandbox - I copy $TMP into the sandbox - I download denort-x86_64-unknown-linux-gnu.zip and copy it into the sandbox...

node stream.Readable.on not a function.

In Node we can listen to data on a readable stream using .on("data"). This method does not seem to exist in Deno. What should we use as a replacement and is it compatible with node?

Event Loop for a bot

Supposing I had a function in a script for a bot that gives me all the tweets a user has posted on X.com (sharkey, actually, but lets just say x), how would I make some kind of an event listener on a server that listens for mentions of the bot's account? I was thinking about making an infinite loop but that seems wildly inefficient.