Deno

D

Deno

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

Join

Is there a function which can print a structure in deno/typscript similar to print_r in php ?

I would like to know which attributes and structure members a struct have and asked my self if there is something similar in deno/typscript to php https://www.php.net/manual/en/function.print-r.php I use deno 2.0.0-rc.5. Here the code which I use. The questioned line is this console.log(anchorTag.) //<= How to dump anchorTag? ```...

workspace setup

Hi, a want to setup such structure, is it supported by deno workspace:? /project /apps /webapp...

Unable to download rc version on mac

I'm on MacOS 11.7.10 (Big Sur). While trying to download the 2.0 rc version with deno upgrade rc. But soon after I get the error message dyld: malformed mach-o image: dyld chained fixups info underruns __LINKEDIT / error: Failed to validate Deno executable. This may be because your OS is unsupported or the executable is corrupted. Is this because my mac isn't supported? If so, will mac be supported? Or am I doing something wrong?

local modules

working example in package.json ... "styled-components": "5.3.11", "moduleX": "file:./local_modules/moduleX/", .......

Fresh issues out of the box?

I newly installed deno. I followed the instructions on Fresh's docs pages to get a new project started. I select yes when prompted to use a styling library. I select the recommended tailwindcss. I cd into my new fresh-project. Run deno task start then I get thrown this "error: Uncaught (in promise) TypeError: Could not resolve 'npm:tailwindcss@3.4.1'" I would appreciate any feedback on this because I can't get past the starting line...

deno not recognized

i am trying to install deno, but when i try to run commands it says deno is not recognized, but if i try to install deno it says it already exists, any guesses?
No description

RustyV8: Example of creating a TypedArray?

Hey there, I'm currently trying to Zero-copy my ort::Tensor to a v8::TypedArray, but I can't figure out how to work with the byte_offset and length parameters of v8::Float32Array or other TypedArray variant. Here is an example of my code: ```rust // ... model init...

Adding a lib/rep to deno's lsp

I'm looking for a way to improve search speed by caching or adding to Deno's LSP. At least in VSCode I doubled the GB limit but I still have the same issue. I was wondering how I could use a local files for this search....

I couldn't install 'deno install --allow-scripts=npm:esbuild@0.21.5'

I tried to work with create-vite on deno 2.0.0-rc.4 Version: Deno 2.0.0-rc.4 OS:Debian GNU/Linux...

RustyV8: Example of using PromiseResolver / async?

Is there an example using PromiseResolver? Because it uses a HandleScope, I'm unsure about how to reference it at a later point when async work has been done. Could you provide an example of implementing a async simple sleep function, ideally by pushing an async task to the main Tokio runtime? Problem:...

Is it possible to embed `deno_core` with a self-managed event loop?

And the 2nd question is: does the API deno_core::JsRuntime::run_event_loop only run 1 tick? or it try to wait everything inside its internal queue to complete? Because after reading some tutorials and source code of deno_core, I found there's already some queues inside deno_core, I guess they're for the queueMicrotask and built-in async/await functions. For example, if we have below sample code:...

Embedding RustyV8: Fatal JavaScript out of memory: Reached heap limit

I created this Criterion benchmark to estimate the cost of serialization, but it runs out of memory. Am I supposed to destroy json_v8_str and _json_obj explicitly? ``` let platform = v8::new_default_platform(0, false).make_shared(); v8::V8::initialize_platform(platform);...

Stupid Broken Pipe

how do I handle this without the thing just quitting, I've put try catches everywhere
No description

How to check if stdin is a file?

Hey, how does one check if stdin is a file? in nodejs we could do something like fs.fstatSync(process.stdin.fd).isFile() (example: https://github.com/pinojs/pino-pretty/blob/master/bin.js#L86) which in deno can be translated to Deno.fstatSync(Deno.stdin.rid).isFile. Despite this working for for deno v1, it will not work for deno v2 since both fstatSync and rid will be deprecated, with the first one being deleted entirely. So for deno v2 how can we do this?...

Import PyTorchJS

I wanted to try pytorch with js but I am running into some problems importing the NPM package. Maybe someone here know more. ```
import * as pytorch from 'npm:pytorchjs'
Initialize ⣯ [00:02]...

Deno deployment clarity required?

Each deno deployment will have it's own unique copy of files? and is it counted in 1 GB limit space?

Fully embedding Deno runtime

Hi. Is there any example of fully utilizing Deno as it is originally, and on top of it providing some additional functionality? My background is to create Metamod* plugin with JS runtime to give modders ability to create mods using JavaScript/TypeScript. Firstly, I thought about using Node.js runtime, which has ability to run projects (with package.json) out of the box. However, when you make the bindings of GoldSrc structs/classes and their methods to be able to read/write/run from JS - it's painful, especially when we're talking about C/C++ macros. ...

How to run mocha with deno

How can we run mocha test cases in deno? I have one project created with node and making it compatible with deno. all my test cases has been written in node mocha. so similar way if i try to run deno run test:mocha with the tasks inside deno.json ``` ... "test:deno": "mocha"...

Deno + Vite + DenoKV

Hi, is it possible to use DenoKV in a Deno + Vite Project. Tried to set up Database but seems to be an error not finding Deno at all ... const kv = await Deno.openKv(); results in ReferenceError: Deno is not defined Made a database.ts file in my project src folder.....