Deno

D

Deno

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

Join

How can I import with npm: specifiers through a proxy?

My company blocks npmjs.com and they have setup an internal Artifactory instance. With nodejs I can just setup a .npmrc file with a _registry entry and npm will continue to work. Will deno repsect the .npmrc file or is there another way to configure the registry url?

Following deno_core code execution is slower

So I have the following code, which is taken from https://github.com/denoland/deno/tree/main/core/examples and edited for simple benchmarking: ```rust use std::time::Instant; use deno_core::v8;...

Import modules from all files in directory

Considering I have multiple ts files in a folder and all of them export the same type module. Can I import them like this? import * as things from "./things/";...

Parsing Apache mime.types into dictionary Record<string, string>

This code parses the official Apache mime.types from GitHub and creates a dictionary Record<string, string> of all lines that have not been commented out. Perhaps it may help someone learning and using Deno serve so I wanted to share. ```ts /** * Run command:...

deno.land/x/module not using latest tag

I created a repository, at deno.land/x/shellgpt, and pushed some tags. The latest version is v0.2.0. When I do deno install -A --name gpt https://deno.land/x/shellgpt/mod.ts ...

Provide own default error page in Fresh

Hello! I'm seeing the following error
pragma cannot be set when runtime is automatic at https://deno.land/x/fresh@1.0.1/src/server/default_error_page.tsx:1:1
pragma cannot be set when runtime is automatic at https://deno.land/x/fresh@1.0.1/src/server/default_error_page.tsx:1:1
Can I provide my own default error page instead of this one to sidestep this error? I tried making such a page at routes/default_error_page.tsx, but that didn't work...

Smoother DX using 3rd party modules written in TypeScript in the Browser

Say, for instance, I want to use the "async" standard library's Deferred implementation in some code that runs in the Browser. Currently I manually copy the TypeScript source to a vendor folder and have my build step do the transpilation, then have my import map point to the transpiled code. Is there a way to have Deno or a complimentary tool do the transpiling with less manual intervention and allow a developer to use the original URL for the TypeScript module in their import map? [Aside: wasn't quite sure whether to post this in #help or #ideas . Kinda straddles the line to me šŸ¤·šŸ»ā€ā™‚ļø ]...

grpc / http2 / https in fresh.

please a correct way to use grpc / http2 / https in fresh.

Issue using scopes to change a version

I'm using https://deno.land/x/markdown@v2.0.0/ and I get the following error: ```bash Warning Implicitly using latest version (0.182.0) for https://deno.land/std/encoding/_yaml/loader/loader.ts error: Module not found "https://deno.land/std/encoding/_yaml/loader/loader.ts"....

Importing local Node.js modules

I have a local Node.js/TS package in local directory /foo/bar/leet/package.json – Is there any way to import and use this in a Deno project?

Server Sent Events with Fresh

Hi! I am trying to use Server Sent Events (SSE) with fresh. I understand I should have an island that holds the connection to the server but how can I broadcast the notifications to other islands?

Twind intellisense stop working

Out of the blue, intellisense stopped working even though I installed the twind and deno extensions in VS Code. Has anyone experienced something like this and know how to fix it? VS Code: 1.77.1 Deno: 1.32.3 Fresh: 1.1.5...

Is there a way to lint check unnecessary `await`s?

In VSCode, I get this grey hint in the IDE (photo). But I don't see a lint rule for it at https://lint.deno.land/. Is this just an IDE/CLI mismatch? I'd love to make this a warning or error.

How to use Buffers again? Old node path no longer exists

Previously, I used export * from "https://deno.land/std@0.177.0/node/internal/buffer.mjs";. I updated a project to use the latest std library and I have no idea how to get buffers back.

How use namespace on Deno

i am trying to use the same namespace in multiple modules but what used to work in node, doesn't work in deno: ```ts /* test1.ts */ /// <reference path="./test2.ts" />...

Restart Deno process on crash

Hello, The following Node snippet allows a script to restart on crash : ```js import { spawn...

best practice when spawning commands that require sudo?

I am building a command line utility in deno that leverages data coming from tcpdump. To get any meaningful data out of tcpdump, I need elevated permissions. To keep this command portable, that means running sudo tcpdump inside my deno program. How can I set up deno permissions to run a specific command executed through sudo? A simple permission of --allow-run=sudo would be dangerous. I could just let the user approve each time, but even then, all they know is that they are approving sudo, there is no other knowledge of what the subcommand is: `` ā”Œ āš ļø Deno requests run access to "sudo". ā”œ Requested by Deno.Command().spawn()` API. ā”œ Run again with --allow-run to bypass this prompt....

Should "exists" function from STD be used as a last resort?

There was an undo deprecation for "exists" functions but still in the code it says this: Note: Do not use this function if performing a check before another operation on that file. Doing so creates a race condition. Instead, perform the actual file operation directly. So basically this message and the description in the PR, would mean use it but as last resort? e.g: third party scenarios?...