KaKi87
KaKi87
DDeno
Created by KaKi87 on 9/9/2023 in #help
Read permission & NPM imports
Hello, I'm using --allow-read=. to allow a script to read files in the current directory. The script also use NPM imports, because of which it also asks to read /home/{username}/.cache/deno. Can I not need to explicitly allow this path, especially since it will differ depending on operating systems and installation modes ? Thanks
12 replies
DDeno
Created by KaKi87 on 7/19/2023 in #help
How to solve "cannot be invoked without 'new'" thrown from an NPM module ?
Hello, An NPM module (which I don't own) uses call on something, which throws a cannot be invoked without 'new' error. How can I solve this ? Thanks
5 replies
DDeno
Created by KaKi87 on 4/4/2023 in #help
Restart Deno process on crash
Hello, The following Node snippet allows a script to restart on crash :
import {
spawn
} from 'node:child_process';
process.on(
'uncaughtException',
() => {
process.once(
'exit',
() => spawn(
process.argv.shift(),
process.argv,
{
cwd: process.cwd(),
detached: true,
stdio: 'inherit'
}
)
);
process.exit();
}
);
import {
spawn
} from 'node:child_process';
process.on(
'uncaughtException',
() => {
process.once(
'exit',
() => spawn(
process.argv.shift(),
process.argv,
{
cwd: process.cwd(),
detached: true,
stdio: 'inherit'
}
)
);
process.exit();
}
);
What's its Deno equivalent ? Thanks
4 replies
DDeno
Created by KaKi87 on 3/3/2023 in #help
`fetch` request always fails once
Hello, I got a script containing a fetch request. Once in a while, it throws the connection closed before message completed error. But always works at the second and next attempts. How's that possible ? Thanks
1 replies
DDeno
Created by KaKi87 on 11/3/2022 in #help
File line operations
Hello, How to perform the following file manipulations in Deno ? - Read the nth line - Remove the nth line - Add a line before the nth line nth can he anything including and between first and last. Thanks
16 replies