Deno

D

Deno

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

Join

Build and bundle TS into JS

Im starting a pretty muhc new, minimal Ts project that I would like to use Deno to host, and then have a (as much as possible) zero config that bundles all my code (from one entry point) into javascript that can be hosed elsewhere. But, how to do it? seems simple enough but seems like it's very hard to get a "primer" working with zero config. Please help. My other option would obviously be to host on deno deploy, but it's so un-intuitive how to host there. #deploy #bundle #build...

Read dependency directory

Is it possible for a library to read its own non-importable files? I'm publishing some static files in a library. I'd like for that library to copy the files wherever the user wants. Is there a way without transforming those files into importable JSON or JS files? Library:...

Import type: css ?

is there a way to allow this in deno LSP:
import style from './xxx.css' with { type: 'css' };
import style from './xxx.css' with { type: 'css' };
I get "Importing these modules is not supported." deno-ts(6263) ...

How do i import local npm pacakge in deno project?

I'm unable to import npm local package in deno project

Deno.dlopen does not support flags

I am looking to integrate the SDL3 lib, and wanting to get the callback path to work. However, it requires a flag to be enabled, to allow the function pointers to be called. https://wiki.libsdl.org/SDL3/SDL_MAIN_USE_CALLBACKS ```c #define SDL_MAIN_USE_CALLBACKS 1...

Compiled Deno project can't import typescript code

Does Deno compile remove its ability to import typescript code? This only work in deno run, but fails on the deno compile bynary ```async function importjs(js: string, filename = "importedjs") { const dataUri = "data:text/typescript;charset=utf-8," +...

deno compile optimizations

i'm relatively new to deno and find the compilation part interesting. reading the reference, it seems to bundle the deno runtime in the binary. my question is, is there anything else the compilation does? are there any form of ahead-of-time optimizations done? i'm looking into compiling my hono apps and am wondering of all the potential benefits of doing so. thank you....

How to initialize global variable so it can be accessed without globalThis?

I'm hacking on a large existing codebase using Deno. This codebase uses a number of global variables like this:
if( __DEV__ && ... )
if( __DEV__ && ... )
...

Workspace documentation lacks explanation of `exports` member in deno.json

I was reading the documentation on workspaces and monorepos. It shows usage of the exports member ina deno.json file. The example shows it as a single string. There's no explanation of the exports member in the documenation for workspaces, monorepos, nor the "deno.json and package.json" help page, either. I am trying to understand how I can share commonly used enums across all of my microservices; but, I got confused. If my enums are declared in individual *.ts files (e.g. Statuses.ts, ExpirationTypes.ts, etc), how do I mark this up in my root-level and module-level deno.json files such that I can access the enums from within all modules? Specific example:...

Unable to log in to deno deploy

When logging in with a GitHub account on "deno deploy," an error message is displayed: "Cannot read properties of null (reading 'id')."
No description

Proper way to install deno on NixOS

I have just installed deno through: curl -fsSL https://deno.land/install.sh | sh But i am on nixos, what should be the proper way to install and run deno on NixOS?...
No description

unable to see documentation on deno.land/x

I just wanted to install jose, but the "view documentation" button seems to be missing...
No description

Deno land file path

Hey all, I'm trying to understand when I'm looking at a module on deno.land/x, how do I know the file path to use for an install? Is it solely reliant on the documentation provided on the module page?...

workaround for ts-node in package.json script

1. many existing projects use package.json script with ts-node. 2. due to https://github.com/denoland/deno/issues/17176 deno can't run them.
"compile:typebox": "ts-node cases/typebox/index.ts cases/typebox/build",
"compile:typebox": "ts-node cases/typebox/index.ts cases/typebox/build",
...

Help setting up a Deno project for a static HTML5 app using TypeScript and a Live-preview.

Hi all, i'm new to deno and want to try it out. 😉 https://discord.com/channels/684898665143206084/1128726030614544414/1332270619060076594 Although i'm not completely new to TypeScript (I can somewhat read it), unfortunately have not coded using it till now, at least that's the plan to start using it . Below are topics i want to cover / make use of:...

`--unstable-sloppy-import` not working

``` scarf@fedora ~> deno repl --no-lock --unstable-sloppy-imports Deno 2.1.9 exit using ctrl+d, ctrl+c, or close()
import { pipe } from 'npm:fp-ts/function'...

validateSchema getting better with v2.1.8 - but still not yet working

Hi all 👋 , I want to validate some xml files to a given xsd. npm:xsd-validator ...

Moving code to src/ caused VSCode errors about imports

Hi. I just started a new project, and at first I had all my code in root workspace directory, together with deno.json. I had subdirectories also, but the main files were at the top. Everything worked just fine. Now I decided to move all code to src directory and it caused errors like this popping up in VSCode: ``` Relative import path "drizzle-orm/pglite" not prefixed with / or ./ or ../...

Unable to update entrypoint configuration on Deno Deploy

I'm confused and stuck on updating the entrypoint for a project on Deno Deploy. I had initially set up the entrypoint at a different path, but then moved the entrypoint file and updated the deploy.entrypoint field of my deno.json to match the new path. Running deployctl deploy from the root directory results in a successful deployment. But pushing to main and triggering the Git hook for prod deployments continues to fail, when Deploy tries to find a now-nonexistent entrypoint. It seems as if Deploy isn't reading the deno.json to determine the entrypoint? Cross posted from my original message at https://discord.com/channels/684898665143206084/826085979344470037/1333951330607173713....

Deno Emit for Bundling - Potential Open Source Contributions

Hi Deno Team, We're exploring using deno emit as the future of bundling for Deno projects and are very interested in contributing to its development. Our team is ready and willing to submit PRs and tackle open issues related to deno emit as open source contributions. Before we begin, we'd like to confirm that you're also considering deno emit for this purpose and that there aren't any other planned approaches at the moment. This confirmation would allow us to align our efforts with your vision and ensure our contributions are valuable....