Hasan Rimawi
Hasan Rimawi3mo ago

Deno Install <>

How can I use deno install subcommand? Can't find documentation about it nor examples.
3 Replies
Deno AI Helper
Deno AI Helper3mo ago
The deno install subcommand is used to install executable scripts from URLs into your system. Here's how you can use it according to the documentation: 1. To install a script, you run deno install with the necessary permissions and the URL of the script. For example:
deno install --allow-net --allow-read https://deno.land/std/http/file_server.ts

deno install --allow-net --allow-read https://deno.land/std/http/file_server.ts

This command will compile the script and create an executable shell script that invokes deno with the specified permissions and main module. 2. If you want to change the name of the executable, you can use the -n or --name option:
deno install --allow-net --allow-read -n serve https://deno.land/std/http/file_server.ts

deno install --allow-net --allow-read -n serve https://deno.land/std/http/file_server.ts

This will install the script with the custom name serve. 3. You can also specify a different installation root using the --root option:
deno install --allow-net --allow-read --root /usr/local https://deno.land/std/http/file_server.ts

deno install --allow-net --allow-read --root /usr/local https://deno.land/std/http/file_server.ts

Remember to add the installation root's bin directory to your system's PATH if it's not already there. 4. When installing scripts, you must specify the permissions that the script will need at runtime. For example, if you want the script to run with network and read permissions and bind to port 8080, you would do:
deno install --allow-net --allow-read https://deno.land/std/http/file_server.ts -- -p 8080

deno install --allow-net --allow-read https://deno.land/std/http/file_server.ts -- -p 8080

For more detailed examples and usage, you can refer to the Deno documentation on script installer. 🦕
coty
coty3mo ago
DENO_FUTURE=1 deno install --help
DENO_FUTURE=1 deno install --help
𝖉𝖊𝖓𝖔𝖇𝖊𝖘𝖙  (2023KUDA01)
deno install <js/ts> is what you should know if youre a beginner like me but yea aactually do
deno install --help
deno install --help