Skip to content

Instantly share code, notes, and snippets.

View Vehmloewff's full-sized avatar
🤦‍♂️
Efficiency begot effectiveness and the daughter devoured the mother

Elijah Mooring Vehmloewff

🤦‍♂️
Efficiency begot effectiveness and the daughter devoured the mother
View GitHub Profile
@Vehmloewff
Vehmloewff / drun.sh
Created December 18, 2024 20:53
Run a typescript function directly
#!/bin/bash
filepath=$1
funcname=$2
[[ $filepath != *.ts ]] && filepath="$filepath.ts"
dataurl='data:text/typescript,import { '$funcname' } from "file://'$(pwd)'/'$filepath'";console.log(await '$funcname'());'
deno run -A "$dataurl"