cowboyd
Explore posts from serversIs there a way to read the current raw options for stdin?
I want to create an operation that uses raw input from stdin, but then resets it afterwards to whatever it was when the operation started. In other words, if it was already raw, then it should remain raw. If it was not, then it should be reset to be not raw. The same applies for the value of the raw options: e.g.
{cbreak: true }
In order to do this, I need to read the current raw options. Is there a way to do this?1 replies
Aarktype
•Created by cowboyd on 9/3/2024 in #questions
How to type an expressjs-like route handler based on the path pattern.
If I define an application like:
get('/path/:id?q=:query', handler)
is it possible to look at the structure of the string and infer the type of the parameters that are passed to the handler
function as { id: string; query: string;}
. Given the prevalence of this pattern, I'd expect that someone has attempted it before, but I can't seem to find it in the docs and/or discord.22 replies
Custom JSX transform from local module
Is it possible to define a JSX transform within the same codebase? All of the examples show referencing it from a remote module like
https:/esm.sh/preact
I've tried this, but it is unable to load my local jsx-runtime
module because it doesn't recognize it as bing JS or TS.
https://github.com/cowboyd/deno-jsx
I've considered using an import map, but I'd like to see if it can be done without one if possible.1 replies