phantom
Version:
PhantomJS integration module for NodeJS
19 lines (15 loc) • 638 B
Flow
// @flow
import Phantom from './phantom';
/**
* Returns a Promise of a new Phantom class instance
* @param args command args to pass to phantom process
* @param [config] configuration object
* @param [config.phantomPath] path to phantomjs executable
* @param [config.logger] object containing functions used for logging
* @param [config.logLevel] log level to apply on the logger (if unset or default)
* @returns {Promise}
*/
function create(args?: string[] = ['--local-url-access=false'], config?: Config): Promise<Phantom> {
return new Promise(resolve => resolve(new Phantom(args, config)));
}
module.exports = { create };