MCPcopy Create free account
hub / github.com/Xyntopia/taskyon / loadScript

Function loadScript

src/modules/pyodide.ts:6–16  ·  view source on GitHub ↗
(src: string)

Source from the content-addressed store, hash-verified

4//import { loadPyodide, PyodideInterface } from 'pyodide';
5
6function loadScript(src: string): Promise<void> {
7 // Specify 'void' if the promise doesn't return a value
8 return new Promise<void>((resolve, reject) => {
9 // Again, specify 'void' here
10 const script = document.createElement('script');
11 script.src = src;
12 script.onload = () => resolve(); // No arguments are needed for 'resolve' since no value is returned
13 script.onerror = () => reject(new Error(`Script load error for ${src}`));
14 document.head.appendChild(script);
15 });
16}
17
18export async function execute(python_script: string) {
19 try {

Callers 1

executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected