easrng avatar
oldstyle
@easrng
Script
oldstyle bring back the old @​import.syntax usage: import oldstyle from "https://esm.town/v/easrng/oldstyle"; const fn = await oldstyle` export default async () => { // import vals const fetchFns = [@std.fetch, @easrng.moduleFetch]; console.log( await Promise.all( fetchFns.map((fn) => fn("https://icanhazip.com").then((res) => res.text()), ), ), ); // get environment variables with @me.secrets console.log(@me.secrets.FORCE_COLOR); // update vals console.log(@easrng.counter++); }; // you don't have to have an export btw `; fn();
websandbox avatar
run
@websandbox
Script
An interactive, runnable TypeScript val by websandbox
1
Next
March 6, 2024