airtap-multi
Use multiple browser providers as one.
Usage
const Multi = const multi = multimulti // Get manifests with name 'firefox'const manifests = await multi // Only from the airtap-sauce providerconst manifests = await multi // Instantiate a browser (see browser-provider for details)const browser = multi
API
multi = new Multi()
Implements the browser-provider
interface with a few additional methods.
multi.add(id[, options])
Add a provider that's been installed in a nearby node_modules
. The optional options
object will be passed to the provider's constructor.
multi.add(object[, options])
Add multiple providers in the form of { [id]: options }
:
multi
If the second options
argument is provided, those options will be deeply merged into the options of each provider.
multi.add(fn[, options])
Add a provider as a constructor function.
multi.add(array[, options])
Add multiple providers using an array, where each array element is of the above types (string, object or function).
provider = multi.get(id)
Get an added provider by its id.
iterator = multi[Symbol.iterator]()
for const id provider of multi // ..
iterator = multi.keys()
for const id of multi // ..
iterator = multi.values()
for const provider of multi // ..
Install
With npm do:
npm install airtap-multi
License
MIT © 2020-present Airtap contributors