UNPKG

magica

Version:

ImageMagick for browser and Node.js, easy setup, high level API and Command Line Interface, including WASM binary for an easy setup.

30 lines 989 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const options_1 = require("../options"); const magickLoaded_1 = require("./magickLoaded"); function createMain(Module, FS) { return function main(...args) { var debug = options_1.getOption('debug'); magickLoaded_1.resetStdout(); magickLoaded_1.resetStderr(); let returnValue, error; try { Module.noExitRuntime = true; debug && console.log('before Module.callMain'); returnValue = Module.callMain(...args); debug && console.log('after Module.callMain', returnValue); } catch (ex) { debug && console.error((ex)); error = ex; } return { returnValue, stdout: magickLoaded_1.getStdout(), stderr: magickLoaded_1.getStderr(), error }; }; } exports.createMain = createMain; //# sourceMappingURL=createMain.js.map