
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
desired-capabilities
Advanced tools
Tools for generating Selenium browser specs from shorthand strings and objects.
npm install desired-capabilities
capabilities(str) or capabilities.parse(str)Parses the a string in the form:
browser(@versions)?(:platforms)?
where:
versions can either be a single version or an inclusive numeric range in
the form start..end.platforms can be one or more comma-separated platform names or
shorthands, such as xp or win7.var caps = require('desired-capabilities');
var assert = require('assert');
assert.deepEqual(caps.parse('ie@8:xp'), {
browserName: 'internet explorer',
browserVersion: '8',
platform: 'Windows XP'
});
Consult the Sauce Labs or BrowserStack docs for a list of available browsers and platforms.
capabilities(obj) or capabilities.expand(object)Returns an array of variations of the provided capabilities object
for each of the browserVersion and platform values, using the
same logic as the string parser.
var caps = require('desired-capabilities');
var assert = require('assert');
assert.deepEqual(caps({
browserName: 'Chrome',
browserVersion: '8..9'
}), [
{
browserName: 'Chrome',
browserVersion: 8,
platform: 'any'
},
{
browserName: 'Chrome',
browserVersion: 9,
platform: 'any'
}
]);
capabilities(array)Expands or parses all of the values in the array to produce one big list of capabilities. The values in the array may be either strings, objects, or nested arrays.
var caps = require('desired-capabilities');
var assert = require('assert');
assert.deepEqual(
caps(['phantomjs', 'ie@8..9', 'chrome@40', {
browserName: 'ff',
browserVersion: 36
}]),
[
{
browserName: 'phantomjs',
browserVersion: 'any',
platform: 'any'
},
{
browserName: 'internet explorer',
browserVersion: 8,
platform: 'any'
},
{
browserName: 'internet explorer',
browserVersion: 9,
platform: 'any'
},
{
browserName: 'chrome',
browserVersion: '40',
platform: 'any'
},
{
browserName: 'firefox',
browserVersion: '36'
platform: 'any'
},
]
);
FAQs
utilities for parsing shorthand Selenium capabilities objects
The npm package desired-capabilities receives a total of 23,987 weekly downloads. As such, desired-capabilities popularity was classified as popular.
We found that desired-capabilities demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.