python-js-executor
Version:
Execute Python code and files from JavaScript with full import support
21 lines (19 loc) • 690 B
TypeScript
declare module 'python-js-executor' {
export default class PythonRunner {
constructor();
/**
* Run Python code from a file
* @param pythonFile - Path to the Python file
* @param args - Arguments to pass to the Python script
* @returns Promise resolving with the Python script output
*/
runFile(pythonFile: string, args?: string[]): Promise<string[]>;
/**
* Run Python code directly from a string
* @param code - Python code to execute
* @param args - Arguments to pass to the Python code
* @returns Promise resolving with the Python code output
*/
runCode(code: string, args?: string[]): Promise<string[]>;
}
}