
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
each-version
Advanced tools
CLI to run a given command against each configuration of dependencies in each.json
each-version will take a given command and run it against all specified variations of your dependencies. An example usage
might be if you want to verify that your Angular directive library works against all your supported versions of Angular
(say 1.2.x, 1.3.x, 1.4.x, 1.5.x). You can also use this to verify that you are always working against the latest release of
a library, helping keep your dependencies green.
To accomplish this, each-version will uninstall all specificed dependencies and install the requested versions once for
each environment specified and then run the requested command. It then aggregates the results and reports them back.
each-version is meant to be used as either a CLI or programatically. To install:
npm install each-version
All the usual rules for npm install in regards to CLIs apply. You can use it as a dependency or a devDependency.
You can install it globally. You can install locally and use it in npm run scripts. All the goodies.
CLI usage requires a .each.json file to be available. It must be an array of environments. All enviroments must contain
all the same dependencies. An environment has three properties:
[
{
"name": "latest",
"libs": {
"lodash": "latest"
},
"strat": "fail"
}
]
nameCan be any name. Intended for humans when reporting the results of the requested command against that environment.
libsKey/value pairs of npm modules and valid version references. Should look like a dependencies section of a package.json.
Examples of valid version references:
latest*~4.1.0^4.1.04.1.04.1.x>= 4.1.0package.json's dependency sectionstrat (optional, default="fail")Instructions on how to handle non zero exit codes. Options are:
"fail" (default)
stderr"bail"
stderr"warn"
stderreach command to run, for example if I want to run my unit tests and they are using Karma:
each karma start
The command will return a zero/non zero exit code based on the results of the command and the configuration of your
.each.json. See "strat" in this README.
The library will return a promise with the results of the command against each environment. Example:
const each = require('each-version');
const config = require('./.each.json');
each(`karma start`, config)
.then(results => {
const failures = results
.filter(result => !result.pass)
.map(result => `"${result.environment}"`);
console.log(failures.length === 0 ? 'Success!' : `Failed in the following environments: ${failures.join(', ')}`);
})
.catch(err => {
console.error(`"${err.command}" failed under environment ${err.environment}.`, err.error);
});
A naive implementation is being used for the initial release. Performance improvements could definitely be added down the road.
This library requires at a minimum, node.js version 4.
MIT License
FAQs
CLI to run a given command against each configuration of dependencies in each.json
The npm package each-version receives a total of 9 weekly downloads. As such, each-version popularity was classified as not popular.
We found that each-version 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.