Deno

D

Deno

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

Join

Get a Parameter Value in Oak

so if I set up a router like this
router.get("/:id", (ctx) => {/*handle router context*/})
router.get("/:id", (ctx) => {/*handle router context*/})
then how do I get the value of the id parameter? I have tried ctx.id and it did not accept it

readTextFile() not working?

what is this? its there but its not working
No description

kv store key granuality

How cheap are the kv.get operations? Say I have a userprofile with 3 fields, should I create 3 keys for them, so that I can easily update th 3 fields, or should I keep number of keys low, and just have one value for the user (in that case when updating, one should first get the "complex" value, update it and then write back the updated value)...

deno tap metadata

Hello. I am running deno tests with deno test --reporter=tap. I would like to add additional fields (medatata) to test output as YAML Diagnostic document. This would require some Deno test API for adding metadata: Deno.test({ name: "some test", metadata: { foo: "bar" }, fn: () => {}); or Deno.test({ name: "some test", fn: (t) => { t.set("foo", "bar"); }); this would produce ...

Using ESBuild with Deno

Hey, is anyone more familiar with ESBuild? I am currently trying to transpile my Deno TypeScript project with ESBuild in JavaScript. But I don't want to bundle the files. I just want to transpile them and put them under the same path instead of src in dist. I'm currently doing the whole thing like this: ``` deno run -A https://deno.land/x/esbuild@v0.19.4/mod.js —target=es2022 —outdir=dist ./src/client/** ...

Multiple subdomains

How can I listen for incoming http request on multiple subdomains?

Can't upgrade request to websocket

I want to use a websocket in one of my middlewares. But I keep getting an error saying I can't upgrade my connection: ``` [uncaught application error]: TypeError - Invalid Header: 'upgrade' header must contain 'websocket'...

Access `navigator.geolocation` in deno runtime

Hello, is it possible to access navigator.geolocation in the deno runtime?...

Tracking Down Lost Memory

Hi, I have a long running service that creates many JsRuntimes over time and I have found that I am slowly leaking memory. While trying to figure out what's going on, I found that the following simple piece of code seems to leak memory: ```rust...

`deno run` ignores @deno-types?

Uncaught SyntaxError: The requested module 'pg' does not provide an export named 'Pool'
import { Pool } from "pg";
Uncaught SyntaxError: The requested module 'pg' does not provide an export named 'Pool'
import { Pool } from "pg";
I get the above error for the below line...

Where is my Twitter access token with Deno KV Oauth?

I signed in successfully and now the Deno KV database is just storing true. It's not enough to interact with the Twitter account?

How do I import the stripe SDK into my fresh.js project

Hi there! How do I import the stripe SDK into my fresh.js project? Im struggling with my deno.json file and how to initialize the SDK in a typescript file

Unable to find NPM:Rollup 4.1.4 on M1 Mac

Hi all, hooking up a new build process for UI project, trying to use Rollup on an M1 Mac. My build script starts with: import { rollup } from "npm:rollup@4.1.4";...

How to get custom folder structure with Fresh?

Hello, I want to integrate Fresh into my existing project. I want to use the 4 directories: components, routes, islands and static but I want them inside a directory in the project like ./src/fresh/

Fresh error: Could not fetch latest version

Total newbie here. I'm getting "Update check failed: Could not fetch latest version." when I make a change like replacing {a} with {b}, for example. The page is not updating automatically (but it works if I refresh manually). This is my test component. What am I missing? I'm sure it's something super basic. ```js...

VSCode Test Debugging

```json { "name": "Test", "request": "launch", "type": "node",...

Can you recommend a mysql driver for deno that isn't a complete dead end?

mysql2 port: never updated. mysql driver: doesn't support strings mysql connector from Oracle: no one cares to port to Deno. ALL, I mean ALL I can think about is going back to superb PHP PDO. What a challenge......

Help with Slack CLI Deployment

Sorry if this has already been answered, but I am trying to deploy my Slack app and I keep getting this error: "Node specifiers have not yet been implemented for this subcommand (https://github.com/denoland/deno/issues/15960). Found: node:assert". I have uninstalled all node deps and replaced my import statements with esm.sh links but this doesn't seem to have helped. Any ideas on next steps? Thank you in advance

Organizing dependencies in workspace with several project folder

Suppose you have a workspace with several folder, and in each folder you have a deno project. What is the best solution to handle dependencies for this workspace ? - A single import_map.json at the root of the workspace and each project reference it in their respective deno.json with the importMap property ? - Defining for each project the imports key in their respective deno.json ? - Another option ?...

GitHub CLI from deno

Is it possible/how to use the GitHub cli (gh) from JavaScript on deno? Using the Github cli I'm able to generate download_urls for files on a private repo without exposing my github token to the application My idea is to call it from javascript side and return the url from an api, but i've no idea if its possible to run such tool from deno server...