3 var instances = require("./instances.js");
6 * Terminates all running PhantomJS processes. Returns a Promises/A+ compliant promise
7 * which resolves when a processes terminated cleanly.
11 function disposeAll() {
12 var copy = instances.slice(0); // copy the array because phantom.dispose() will modify it
14 return Promise.all(copy.map(exit));
19 * @param {Phantom} phantom
22 function exit(phantom) {
23 return phantom.dispose();
26 module.exports = disposeAll;