Deno

D

Deno

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

Join

Is there any way to disable Deno's Intellisense feature without disabling Deno itself?

When programming with Deno, I've noticed how relatively slow the lang server is, and I need intellisense because I suck at typing and love when I can just press tab and autocomplete what I need. With Deno's server speeds, I can't do that. Can I disable Deno's intellisense and use base TypeScript intellisense?

Deploying Lume to github pages

I'm totaly new to this, but have been following instructions to build a site with lume. It works locally through VSCode on localhost, and now I want to deploy on github pages. I've committed the changes to the repo, and created an action exactly give here: https://lume.land/docs/advanced/deployment/#github-pages but it fails on the deploy action. I'm guessing that I need to customise a parameter, but I can't find any guidance on this. Can anyone advise please? Error: Creating Pages deployment failed Error: HttpError: Invalid environment node id...

Best hardware for Deno development?

I am looking for a new laptop / desktop for Deno development as my current setup seems no longer viable (to my big surprise). I have ThinkPad X1 with Intel Core i7 CPU @ 2.40GHz, 8GB RAM, fast SSD drive and Windows 10 Pro. I am using VS Code for development, and even if I just run one instance of VS Code and Chrome alongside it (e.g. to develop Fresh apps), I am hitting memory and CPU limits and the developer experience is terrible, as the LSP responses lag significantly. I have the system pretty optimized and do not have any bloatware installed that could negatively affect the available resources, yet the development of Deno apps is not great. With every change in code, the CPU consumption skyrockets and the whole VS Code feels laggy for a couple of seconds. My system is pretty old, but still the specs are not that bad, considering that I am just building lightweight apps. I've also used the same system for Android, .NET and Node.js development in the past without issues. I do not have a preference regarding OS, I have worked with Win/Mac/Linux in the past. What I want is a machine that will allow me to have snappy auto-complete in VS Code and will not force me to constantly keep an eye on memory and CPU consumption. What would you recommend? Budget is of no concern, I really just want the best tool. Thank you!...

How do I make the crypto.subtle.digest algo flexible?

This is a learning moment, bear with me. ๐Ÿ˜… I can hard code an algo for the digest like this: ```typescript const algo = "SHA-256";...

whatโ€™s the current best practice for bundling?

Is it deno esbuild? Wondering what supports npm specifiers and bundling atm...

How do I get a d.ts file to be used?

I'm extending a type from hono by adding that code in a hono.d.ts file in my src folder. ``` declare module "hono" { interface ContextVariableMap {...

โ€œLog streaming APIโ€ on Deno Deploy

What does โ€œLog streaming APIโ€ refers to in the analytics section of the pricing page of Deno Deploy?

Read-only FS detection

Hi, I have few deps that by default create cache/log dirs... I can disable it, but the detection itself is unclear. Is there a better way than ```typescript const canWriteToFs = (() => {...

Is there a built-in parser for the string that Deno.inspect produces?

I found out in another thread that Deno.inspect(myObj) produces a visually gorgeous string representation of objects and can represent internal data structures that JSON.stringify fails to represent. (Thank you @cknight for helping me with that!) My next question is, does Deno happen to have the analog of JSON.parse for what gets output by Deno.inspect? Can we take the Deno.inspect output and turn it back into what would become a clone of the original object?...

How to get the nice Deno console.log format into a string?

When I do a console.log on an instantiated class object, I get a beautiful format in the terminal, thanks to Deno. How would I get that same nice Deno format into a string? When I do obj.toString(), I just get the standard Javascript [object Object].

byonm - force use of Deno

When I use byonm enabled in my deno.json, and say I have a vite project triggered from a package.json with i.e. "deno task dev", it appears to just my code with Node.js underneath. Is there a way to force use of deno througout, somewhat similar to what bun has with --bun flag to overwrite uses of Node.js?...

Can I disable deno linting for individual files, or a path?

I'm using VSCode and the Deno extension. I want to use the inbuilt functionality of VSCode for type checking client-side JavaScript (in /website/js for this project) and Deno's type checking for other TypeScript files. I like what I'm doing with TypeScript and I'd like a similar experience with regular JS. So I did some reading about JSDoc and type-safe JS, but when I tried to set it up with a tsconfig.json file, it didn't do anything. If I add // @ts-check to the top of the JS files I want to check, I get incorrect error messages from deno-ts. In the screenshot, for example, it doesn't know what document is and it's just fine with identifying the type of the ui variable as String when it should be Element. It recommends adding something like "lib": ["DOM"] to compilerOptions in the config, but I tried that and it's pretty clear that nothing it's not reading tsconfig.json....
No description

Rust run JS/TS

How can I embed this project into a rust application so that rust can run js ts and has runtime api For example fetch

Set-Cookie - Header shows as "deleted"

I am trying to use deno to script/scrape a website. I can successfully log in to the site (using fetch), however the Headers do seem to get redacted. Instead of seeing a long token, I only get "deleted". the Cookie is set to expire one second after the epoch (is that influences anything) and another Cookie shows up completely fine. Without the cookie I can't take any further actions on the site, because the Cookie in question contains the Session Cookie....

I keep running into python download failed while trying to run 'cargo test' command

I am currently following the steps I. Deno's Contributing Guide and I am running cargo test but I keep getting this error and I have Python installed and working correctly
No description

how I can create an restful api with deno and firebase as database?

how I can create an restful api with deno and firebase as database?

How can I replace writeAllSync with the Streams API?

How would one best refactor the following code to use the Web Streams API as suggested by the deprecated stdlib streams module? I was hoping to not have to change this to async for now. writeAllSync(Deno.stdout, this.encoder.encode(msg));...

Is possible to run nodejs (typescript) project with esm modules?

I'm trying to run small nodejs project with esm modules. Simple example ```ts // foo.ts import { bar } from './bar.js';...

Any tutorial links to help me understand the Schedule string in Deno.cron()

I am currently working on an issue on the deno repo and I am trying to reconstruct the deno schedule string from an object, but I am finding it a little bit hard to find any resources that explains the Deno.cron() function parameters especially the schedule string. I would really appreaciate it if anyone could help explain the schedule string or at least provide some resources I could read it up on. I got this image from the issue but the thing is that most of the asterix doesn't make sense at least to me. I understand there is minute, hour and days_of_week but there are two unidentified * that I don't really know what they reperesent....
No description

Deno Deploy failed:Uncaught Exception /Permission Denied : Deno.exit() is not allowed

I have a college assignments that needs to be deployed using deno deploy but i get this message when i try to deploy it, my code works fine locally.
No description