https://github.com/airtap/match-browsers
Match browser manifests to a desired set of browsers.
https://github.com/airtap/match-browsers
airtap browsers nodejs npm-package zuul
Last synced: 4 months ago
JSON representation
Match browser manifests to a desired set of browsers.
- Host: GitHub
- URL: https://github.com/airtap/match-browsers
- Owner: airtap
- License: mit
- Created: 2020-03-01T12:43:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T11:00:53.000Z (over 2 years ago)
- Last Synced: 2025-05-14T23:17:12.843Z (5 months ago)
- Topics: airtap, browsers, nodejs, npm-package, zuul
- Language: JavaScript
- Homepage:
- Size: 166 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# airtap-match-browsers
> **Match [browser manifests](https://github.com/airtap/browser-manifest) to a desired set of browsers.**
> Replaces [`sauce-browsers`](https://github.com/lpinca/sauce-browsers) in conjunction with [`airtap-sauce-browsers`](https://github.com/airtap/sauce-browsers).[](https://www.npmjs.org/package/airtap-match-browsers)
[](https://www.npmjs.org/package/airtap-match-browsers)
[](https://travis-ci.com/airtap/match-browsers)
[](https://standardjs.com)## Usage
```js
const sauce = require('airtap-sauce-browsers').promise
const match = require('airtap-match-browsers')// Browsers available on Sauce Labs, as manifests
const available = await sauce()// Browsers that we want, by manifest properties
const wanted = [
{ name: 'firefox', platform: 'linux' },
{ name: 'chrome', version: '78..latest' },
{ name: 'ios safari', version: '13' }
]// Find matches
const manifests = match(available, wanted)
```## Properties to match on
### `name`
Required, must be a string. Matched loosely using [`browser-names`](https://github.com/airtap/browser-names).
### `version`
Defaults to "latest". Supported forms (compatible with Zuul & Airtap):
- An exact or partial version ("6" matches "6.0").
- A keyword, one of "oldest" (first version) or "latest" (last stable version).
- A range in the form of `..`, where `start` and `end` are either a version or a keyword. This will result in one or more matches.
- A negative range in the form of `-..latest`, for example `-1..latest` which means the last 2 stable versions.
- A prerelease version like "dev", "beta", "80.0a1". Such versions sort after stable versions, so that `oldest..latest` excludes "dev" and `latest..dev` includes e.g. latest, "beta" and "dev".
- An array of versions.If a manifest doesn't have a `version`, it behaves like a prerelease.
### `platform` and any other (nested) property
Yet to document. A quick example:
```js
const manifests = match(available, [{
name: 'chrome for android',
version: '10',
capabilities: {
appium: {
// Select a specific emulator (case-insensitive)
deviceName: 'google pixel 3a googleapi emulator'
}
}
}])
```## Specifying options
Yet to document.
## Deduplication logic
Yet to document.
## Install
With [npm](https://npmjs.org) do:
```
npm install airtap-match-browsers
```## License
[MIT](LICENSE.md) © 2020-present Vincent Weevers