Doctor 🤖
Doctor 🤖
DDeno
Created by alex-009 on 9/25/2024 in #help
Can I "execute" javascript in deno?
globalThis.document doesn't exist in Deno though
4 replies
DDeno
Created by alex-009 on 9/25/2024 in #help
Can I "execute" javascript in deno?
Yes, if the script only uses APIs available in Deno
4 replies
DDeno
Created by tetie on 9/25/2024 in #help
Unable to download rc version on mac
I'm not sure then. The only different between you and me is that I'm on a later OS version
22 replies
DDeno
Created by tetie on 9/25/2024 in #help
Unable to download rc version on mac
How did you originally install deno?
22 replies
DDeno
Created by m4rc3l05 on 9/21/2024 in #help
How to check if stdin is a file?
You can pipe any stdout from one command to another. It doesn't necessarily have to be from a file on disk.
20 replies
DDeno
Created by lowercasebtw on 9/21/2024 in #help
Stupid Broken Pipe
Is this all the code?
19 replies
DDeno
Created by m4rc3l05 on 9/21/2024 in #help
How to check if stdin is a file?
I think you'll need to end up changing how your cli intends to work
20 replies
DDeno
Created by m4rc3l05 on 9/21/2024 in #help
How to check if stdin is a file?
Idk if you will be able to still determine if the contents being pipped in is a file or not
20 replies
DDeno
Created by m4rc3l05 on 9/21/2024 in #help
How to check if stdin is a file?
const path = (await Array.fromAsync(Deno.stdin.readable.pipeThrough(new TextDecoderStream()))).join('')

console.log((await Deno.stat(path)).isFile)

console.log(Deno.statSync(path).isFile)
const path = (await Array.fromAsync(Deno.stdin.readable.pipeThrough(new TextDecoderStream()))).join('')

console.log((await Deno.stat(path)).isFile)

console.log(Deno.statSync(path).isFile)
20 replies
DDeno
Created by m4rc3l05 on 9/21/2024 in #help
How to check if stdin is a file?
Assuming the entire stdin is the file path:
20 replies
DDeno
Created by flyingfoxxx on 9/19/2024 in #help
can't access jsr packages in deno v1.3.6
If your version has the jsr: specifier then you can just add it manually to the deno.json file.
4 replies
DDeno
Created by Tino on 9/13/2024 in #help
deno lint missing imports
I can't see a lint rule of that type here https://lint.deno.land/?q=&all=on
2 replies
DDeno
Created by Joseph Crawford on 9/12/2024 in #help
Deno Memory Usage Increases, Does Not Decrease.
If memory keeps going up and never down then it sounds like you may have a memory leak in your code.
40 replies
DDeno
Created by andykais on 9/6/2024 in #help
recommended way to get file checksum
The Web Crypto API does not seem to support streaming files in, and if you aren't consistent with the chunk sizes by rehashing for a readable manner, then you will get different results each time.
3 replies
DDeno
Created by andykais on 9/6/2024 in #help
recommended way to get file checksum
import { encodeHex } from '@std/encoding'

const hash = encodeHex(await crypto.subtle.digest('SHA-256', await Deno.readFile(path)))
import { encodeHex } from '@std/encoding'

const hash = encodeHex(await crypto.subtle.digest('SHA-256', await Deno.readFile(path)))
3 replies
DDeno
Created by Phatso on 8/12/2024 in #help
Importing local files (streaming large JSON files)
const json = JSON.parse(await Deno.readTextFile('path.json'))
const json = JSON.parse(await Deno.readTextFile('path.json'))
6 replies
DDeno
Created by Phatso on 8/12/2024 in #help
Importing local files (streaming large JSON files)
But if it's just one big array or object, then you'd just load it in like any other json file.
6 replies
DDeno
Created by Phatso on 8/12/2024 in #help
Importing local files (streaming large JSON files)
You can use JsonParseStream if it's a file with a single json object on each line.
6 replies
DDeno
Created by Bhaumin on 7/29/2024 in #help
Please help to run puppeteer with deno?
A possible alternative: https://jsr.io/@astral/astral
23 replies
DDeno
Created by foobar on 6/27/2024 in #help
Jsr, esm, x and external ref
Maybe want to open an issue on GitHub
8 replies