DNA
DNA
DDeno
Created by DNA on 5/2/2024 in #help
Ignoring `deno(redirect)` in vscode?
No description
3 replies
DDeno
Created by DNA on 4/8/2024 in #help
Capturing network requests using Puppeteer?
No description
4 replies
DDeno
Created by DNA on 3/25/2024 in #help
Deno.stdin raw map?
Does anyone have a map to which key is what raw buffer gotten from Deno.stdin? Like i can just search in a map, what key 27 represents? Also, i cant use stdin.setRaw(false) Code:
const stdin = Deno.stdin;
stdin.setRaw(true, {cbreak: Deno.build.os !== "windows"});

const maxBuffer = new Uint8Array(1024);
const read = async () => {
const size = await stdin.read(maxBuffer);
const buffer = maxBuffer.subarray(0, size || 0).toString();

Deno.writeTextFileSync("buffer.txt", buffer + "\n", {append: true});

setTimeout(read, 1000 / 60);
};

read();
const stdin = Deno.stdin;
stdin.setRaw(true, {cbreak: Deno.build.os !== "windows"});

const maxBuffer = new Uint8Array(1024);
const read = async () => {
const size = await stdin.read(maxBuffer);
const buffer = maxBuffer.subarray(0, size || 0).toString();

Deno.writeTextFileSync("buffer.txt", buffer + "\n", {append: true});

setTimeout(read, 1000 / 60);
};

read();
3 replies
DDeno
Created by DNA on 3/24/2024 in #help
Kill Deno.Command
Is it possible to kill/end a Deno.command-instance? Example code:
(async () => {
let ffmpegProcess: Promise<Deno.CommandOutput> | undefined;
ffmpegProcess = new Deno.Command("ffmpeg", {args: ["-i", filename, `${folder}/frame%08d.png`, "-threads", "1"]}).output();
await ffmpegProcess;
done = true;
})();

// Later some time
ffmpegProcess.close(); // Something like that?
(async () => {
let ffmpegProcess: Promise<Deno.CommandOutput> | undefined;
ffmpegProcess = new Deno.Command("ffmpeg", {args: ["-i", filename, `${folder}/frame%08d.png`, "-threads", "1"]}).output();
await ffmpegProcess;
done = true;
})();

// Later some time
ffmpegProcess.close(); // Something like that?
10 replies
DDeno
Created by DNA on 3/16/2024 in #help
Setting Deno.Command priority and affinity (on windows)
No description
3 replies
DDeno
Created by DNA on 3/2/2024 in #help
Puppeteer: "BadResource: Bad resource ID" on Ubuntu
No description
65 replies
DDeno
Created by DNA on 12/25/2023 in #help
Custom executable icon for `deno compile`?
Is it possible to set a different icon rather than the default deno icon for the executable generated from deno compile?
18 replies
DDeno
Created by DNA on 11/7/2023 in #help
Changing terminal zoom in windows?
Is it possible to change the terminal zoom using deno? Also, this is about windows terminal, not conhost
2 replies
DDeno
Created by DNA on 10/25/2023 in #help
Access `navigator.geolocation` in deno runtime
Hello, is it possible to access navigator.geolocation in the deno runtime?
7 replies
DDeno
Created by DNA on 9/8/2023 in #help
deno_tui Label-class
Hello. I just started testing around with deno_tui and found the DrawObject-Class. How do i actually use this class? Afaik there is no proper documentation to deno_tui at all and especially not for this class specifically.
131 replies
DDeno
Created by DNA on 9/6/2023 in #help
Convert m3u8 stream to mp4?
Hey. Whats the best /fastest way to convert a m3u8 stream (all files are in a local folder) to a normal mp4 file using deno?
5 replies
DDeno
Created by DNA on 8/28/2023 in #help
deno compile --include argument
In deno compile, how can i include a whole directory instead of just a file? Also, is there a way to include a .env file, because for me, it doesnt work
1 replies
DDeno
Created by DNA on 8/25/2023 in #help
addEventListener for keydown in terminal via deno?
Is there something like addEventlistener("keydown") in deno, so i can capture terminal inputs?
10 replies
DDeno
Created by DNA on 8/23/2023 in #help
Playing sound from file
How can i play the sound from a local file using deno?
2 replies
DDeno
Created by DNA on 8/10/2023 in #help
Get length of video (stream. m3u8)
In deno/typescript, how can i get the length of a specific video stream (m3u8)?
3 replies
DDeno
Created by DNA on 5/25/2023 in #help
Cannot access web server from other network devices when compiled
Hello. Im kinda new to deno and i just compiled my first bigger project with deno, but when the task is running, i can access the website directly from my pc, but not from my phone, which is in the same network. This is my code:
import {serve} from "https://deno.land/std@0.188.0/http/server.ts";
serve(handler, {port: Number(env.PORT), onListen: () => console.log(`Listening on http://localhost:${env.PORT}`)});
import {serve} from "https://deno.land/std@0.188.0/http/server.ts";
serve(handler, {port: Number(env.PORT), onListen: () => console.log(`Listening on http://localhost:${env.PORT}`)});
10 replies
DDeno
Created by DNA on 5/23/2023 in #help
Deno.Command not working for application
8 replies
DDeno
Created by DNA on 5/22/2023 in #help
Sending proper Content-Type depending on file sent
Hello. Im new to Deno and TypeScript and i wanted to convert one of my older projects (NodeJs and JavaScript). Now, my plan is to send the requested file, which actually does work, but the response doesnt send the proper content-type. What do i have to do in order to get this working properly?
const handler = async (req: Request): Promise<Response> => {
const url = new URL(req.url);

const filePath: string = "./client" + (url.pathname === "/" ? "/index.html" : url.pathname);

try {
const file = await Deno.open(filePath, {read: true});
const readableStream = file.readable;

return new Response(readableStream, {
status: 200,
})
} catch (_error) {
return new Response(`GET ${filePath}`, {status: 404});
}
};
const handler = async (req: Request): Promise<Response> => {
const url = new URL(req.url);

const filePath: string = "./client" + (url.pathname === "/" ? "/index.html" : url.pathname);

try {
const file = await Deno.open(filePath, {read: true});
const readableStream = file.readable;

return new Response(readableStream, {
status: 200,
})
} catch (_error) {
return new Response(`GET ${filePath}`, {status: 404});
}
};
4 replies