function execute$$1(configOrCommand) {
    return __awaiter(this, void 0, void 0, function* () {
        const config = asExecuteConfig$$1(configOrCommand);
        config.inputFiles = config.inputFiles || [];
        const allOutputFiles = {};
        const allInputFiles = {};
        config.inputFiles.forEach(f => {
            allInputFiles[f.name] = f;
        });
        let allErrors = [];
        const results = [];
        let allStdout = [];
        let allStderr = [];
        function mapper(c) {
            return __awaiter(this, void 0, void 0, function* () {
                const thisConfig = {
                    inputFiles: values(allInputFiles),
                    commands: [c],
                };
                const result = yield executeOne$$1(thisConfig);
                results.push(result);
                allErrors = allErrors.concat(result.errors || []);
                allStdout = allStdout.concat(result.stdout || []);
                allStderr = allStderr.concat(result.stderr || []);
                yield pMap_1(result.outputFiles, (f) => __awaiter(this, void 0, void 0, function* () {
                    allOutputFiles[f.name] = f;
                    const inputFile = yield asInputFile(f);
                    allInputFiles[inputFile.name] = inputFile;
                }));
            });
        }
        const commands = asCommand(config.commands);
        yield pMap_1(commands, mapper, { concurrency: 1 });
        const resultWithError = results.find(r => r.exitCode !== 0);
        return {
            outputFiles: values(allOutputFiles),
            errors: allErrors,
            results,
            stdout: allStdout,
            stderr: allStderr,
            exitCode: resultWithError ? resultWithError.exitCode : 0,
        };
    });
}
Execute all commands in given config serially in order. Output files from a command become available as
input files in next commands. In the following example we execute two commands. Notice how the second one uses `image2.png` which was the output file of the first one:

```ts
const { outputFiles, exitCode, stderr} = await execute({
  inputFiles: [await buildInputFile('fn.png', 'image1.png')],
  commands: `
    convert image1.png -bordercolor #ffee44 -background #eeff55 +polaroid image2.png
    convert image2.png -fill #997711 -tint 55 image3.jpg
`
})
if (exitCode) {
  alert(`There was an error with the command: ${stderr.join('\n')}`)
}
else {
  await loadImageElement(outputFiles.find(f => f.name==='image3.jpg'), document.getElementById('outputImage'))
}
```

See {@link ExecuteCommand} for different command syntax supported.

See {@link ExecuteResult} for details on the object returned