4 ms·
Personal anecdote: I've fallen in love with Deno as a scripting solution for my desktop machine. It is way more powerful than shell scripting while also being w
by chaorace 5y ago
Personal anecdote: I've fallen in love with Deno as a scripting solution for my desktop machine. It is way more powerful than shell scripting while also being way more portable and clean than a Python or Node script (assuming you end up using at least one dependency, a very common situation in Node).
I know someone's going to ask about permissions making the invocation process a pain, so here's my advice for that: embed the permissions flags in the shebang line!
- Hamcha 5y agoOh the shebang line is a really nice tip I didn't think about! Something worth noting is that Deno also has permission APIs that let you query the current permission status and interactively ask for more: https://deno.land/manual/runtime/permission_apis#request-permissions https://deno.land/manual/runtime/permission_apis#request-per...
- tpoacher 5y agonot sure what you mean by that. would you mind giving an example shebang line that does this?
- chaorace 5y agoHere you go! One example Deno script with permissions embedded in the shebang line: #!/usr/bin/env -S /usr/bin/deno run --allow-net=api.github.com const jsonResponse = await fetch("https://api.github.com/users/denoland"); const jsonData = await jsonResponse.json(); console.log(jsonData);
- tpoacher 5y agoAh, I thought you were referring to filesystem permissions, which confused me! This makes sense. Thanks!