UNPKG

workerboxjs

Version:

A secure sandbox to execute untrusted user JavaScript, in a web browser, without any risk to your own domain/site/page.

16 lines (11 loc) 339 B
declare type WorkerBoxOptions = { scriptUrl?: string, appendVersion?: boolean; }; declare type Scope = object; export type WorkerBox = { run: (code: string, scope?: Scope) => Promise<any>; destroy: () => void; }; declare function createWorkerBox(options?: WorkerBoxOptions): Promise<WorkerBox>; export default createWorkerBox;