Created
          July 24, 2023 15:36 
        
      - 
      
 - 
        
Save humphd/2168e398b6ba83d3fe579f63f429ef13 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
humphd created this gist
Jul 24, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ export const name = "runJS"; export const description = "Runs arbitrary JavaScript code in a browser context (no node.js)"; export const parameters = { type: "object", properties: { "code": { type: "string", description: "JavaScript code to run in browser", } } }; export default async function (data) { const { code } = data; let result; try { result = eval(code); } catch (error) { result = error.toString(); } return result.toString(); }