Deno

D

Deno

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

Join

How to use Tailwind css plugins in FRESH?

is it possible to use tailwind css plugins in Fresh project? if it is, how?...

What am I missing when conditionally styling SVGs

So I have a SVG of an arrow that only has a stroke color. I want to change this stroke color based on a bool value passed to the component, if true color = black else white. Desired output (attached photo): ```export function B({ hold }: DirectionalCommandVariants) { return (...
No description

Error in npm package - how to squelch?

I'm using an npm package that I think isn't being processed for Deno correctly. I get this error: ``` This expression is not constructable....

Is there a way to handle subpath imports within a library?

I'm trying to convert a library package to work with deno. Internally, the package makes a bunch of (different) subpath imports from another library of ours. If this were an application making these imports, I'd just use an import map. However, the docs are pretty clear that, for a library, you should create a deps.ts. The problem with this is that I have to enumerate every single subpath import in the deps file to make it available to other files....

How to connect to a MySQL 5.0.24?

I was trying to use mysql@v2.12.1 to connect to a MySQL 5.0.24 Server but it is not compatible, is there any package compatible with Deno I can use to connect to a MySQL server with mentioned version? I've tried to use npm:mysqld@2.10.2 like import mysql from "npm:mysql@2.10.2";...

Tips for deploying Deno locally?

Do we have a best practice for this? I want to deploy to my LAN only for a particular site. Maybe just “deno task preview” with a systemd service?

How to know when a Deno.Conn is closed

A Deno.Conn is created either with Deno.connectTls or Deno.connect. How do we detect when the connection is closed to handle appropriately? I think I can getReader from the conn's readable and use the closed promise there, but my plan is to pass along the readable so I try not to acquire a lock on that reader....

readFile path not found

I'm trying to use Deno.readFile but when is execute i get an error about wrong path. The files are like this: - db...

Is there a way to read big files using something like .seek but with ending position as well?

So, I'm doing a version of the billion line challenge in JS. I've already implemented a version with Node basically calculating offsets to "slice" the file in a amount og segments matching the available parallelism in the system. To achieve that I'm calling Node's "fs" library like so: ``` const fileReadStream = fs.createReadStream(workerData.filePath, {...

esbuild-deno-loader with npm private registry

Did anyone used the esbuild-deno-loader with npm: specifier while using a private npm registry that requires authentication? Does Deno use the npmrc in any way? I saw the option to set a custom registry, but what about the credentials? I'm getting the "Module not found" error and not sure why. I have the feeling it's a network issue, but the error is too vague....

how to load env variables from .env file in task

the source shell command is not available. I tried ``` "tasks": { "my-task": "export .env && my-command", }...

Is there a way to specify a range and list from KV?

```typescript const kv = await Deno.openKv(); kv.set(["parent", 1], "key1") kv.set(["parent", 2], "key1") kv.set(["parent", 3], "key1")...

PermissionDenied while using ioredis npm package

Hello, I'm facing an issue with an npm library ioredis (https://github.com/redis/ioredis). For some reason, when I tried to initialize a new Redis client using this package, I received an error: error: Uncaught PermissionDenied: Requires env access, run again with the --allow-env flag. No exact env variable is specified in the log. Yes, it works when I allow env globally, but for my system, I would like to avoid allowing all env variables. So, the question is, how can I check which env varia...

Is there a way to obtain Deno.cron schedule info?

Deploy lists the registered cron jobs with name, schedule, last run and next run. Is there a programatic way to obtain this information, in both cli and deploy Deno?

Visual Studio Code Deno does not use node types

I'm trying to use the "esquery" node library with its types, but for any reason Deno ignores the type definitions. File: .vscode/settings.json ```json {...
No description

Drop permissions

I'd like to harden my deno app a bit, but specifying permissions manually gets repetitive. Is there a way for me to run with -A, parse my configs, and then drop all permissions I don't need before loading the rest of the app? Ex. the configuration will contain a database path, so I should keep the r/w permissions for that, but not any other files.

New fresh project comes out of the box with errors

I created a new fresh project on linux, I am using VsCode and im getting many errors although the project seems to run fine with them? Is there some way I could solve these errors or get VsCode to ignore them? Included are just a few of the errors im seeing but they all follow that same "cant find module" convention
No description

Is there a deno function for inputting prompt reply without pressing enter?

Normally, one has to press enter for the input to be accepted. I was wondering if there was a version of prompt or confirm that lets you press a key, and that will automatically register (without pressing enter)...

Setting Deno.Command priority and affinity (on windows)

Is it possible to set a tasks / commands priority and affinity directly? Code: ``ts await new Deno.Command("ffmpeg", {args: ["-i", filename, ${folder}/frame%08d.png`, "-threads", "1"]}).output();...
No description

Is there a way to write a Deno.AtomicCheck that succeeds for any non-null versionstamp?

You can write a Deno.AtomicCheck that fails if the versionstamp for a key-value pair in the KV store does not match the given one. You can also write a Deno.AtomicCheck with a null versionstamp that fails if any key-value pair exists in the KV store. I need to write a Deno.AtomicCheck that fails if there is no existing key-value pair in the KV store....