Skip to content

Instantly share code, notes, and snippets.

@mryhryki
Last active April 24, 2024 08:32
Show Gist options
  • Save mryhryki/20764e285704e29aa075c758a5e273bf to your computer and use it in GitHub Desktop.
Save mryhryki/20764e285704e29aa075c758a5e273bf to your computer and use it in GitHub Desktop.
Demo scripts for STUDDi on 2023-10-10.

Demo scripts for STUDDi on 2023-10-10

How to Use

Prepare

export SCRIPT_URL='https://gist.githubusercontent.com/mryhryki/20764e285704e29aa075c758a5e273bf/raw/index.ts?1'

1. No set allow-flags

deno run "${SCRIPT_URL}"

2. Set partial allow-flags

deno run --allow-net=gist.githubusercontent.com "${SCRIPT_URL}"

3. Set all allow-flags

deno run --allow-net=gist.githubusercontent.com --allow-env="PWD" --allow-write "${SCRIPT_URL}"

4. Specify --allow-all

deno run --allow-all "${SCRIPT_URL}"
{
"data": "f547ff7d-c7d0-4246-b720-257f788809a9"
}
// https://gist.github.com/mryhryki/20764e285704e29aa075c758a5e273bf
const response = await fetch("https://gist.githubusercontent.com/mryhryki/20764e285704e29aa075c758a5e273bf/raw/data.json")
const data = await response.text()
await Deno.writeFile(`${Deno.env.get("PWD")}/example.json`, data)
console.log("SUCCESS!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment