Skip to content

Instantly share code, notes, and snippets.

@srenatus
Last active April 15, 2024 09:14
Show Gist options
  • Save srenatus/b1f64c2282e2fb92040c011df4964de9 to your computer and use it in GitHub Desktop.
Save srenatus/b1f64c2282e2fb92040c011df4964de9 to your computer and use it in GitHub Desktop.
example: use opa-typescript from deno -- run via `deno task dev`
{
"tasks": {
"dev": "deno run --allow-net --watch main.ts"
},
"imports": {
"opa": "https://esm.sh/@styra/[email protected]"
}
}
import { OPAClient } from "opa";
async function run() {
const opa = new OPAClient();
const result = await opa.authorize("system", {
what: "ever",
});
console.debug(result);
}
// Learn more at https://deno.land/manual/examples/module_metadata#concepts
if (import.meta.main) {
run();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment