{"id":17419601,"url":"https://github.com/bendrucker/run-versions","last_synced_at":"2025-08-05T10:17:03.185Z","repository":{"id":65992465,"uuid":"38251154","full_name":"bendrucker/run-versions","owner":"bendrucker","description":"Run a script across multiple versions of an npm package","archived":false,"fork":false,"pushed_at":"2024-09-01T19:44:45.000Z","size":20,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-03T07:05:27.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bendrucker.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-29T14:10:41.000Z","updated_at":"2022-08-01T23:19:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5dba11c-d1fc-47e8-890d-efef1219afa7","html_url":"https://github.com/bendrucker/run-versions","commit_stats":{"total_commits":22,"total_committers":3,"mean_commits":7.333333333333333,"dds":"0.13636363636363635","last_synced_commit":"cbd5f46ff0dafa84f638e5179eb488bbc7dc1713"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bendrucker/run-versions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Frun-versions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Frun-versions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Frun-versions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Frun-versions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendrucker","download_url":"https://codeload.github.com/bendrucker/run-versions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Frun-versions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268876543,"owners_count":24322043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-17T02:27:34.909Z","updated_at":"2025-08-05T10:17:03.083Z","avatar_url":"https://github.com/bendrucker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# run-versions\n\n\u003e Run a script across multiple versions of an npm package\n\n## Install\n\n```\n$ npm install --save run-versions\n```\n\n\n## Usage\n\n```js\nvar run = require('run-versions')\nrun({\n  name: 'xtend',\n  command: 'npm ls xtend',\n  versions: ['3.0.0', '4.0.0']\n}, done)\n//=\u003e done(null, [{version: '3.0.0', passed: true}, {version: '4.0.0', passed: true}])\n```\n\n## API\n\n#### `run(options, callback)` -\u003e `eventEmitter`\n\nIterates through the supplied versions, running the specified shell command at each version. For details on events, see the [events documentation](#events).\n\n##### options\n\n*Required*  \nType: `object`\n\nConfiguration objects for the runner:\n\n###### name\n\n*Required*  \nType: `string`\n\nThe name of the package to install.\n\n###### command\n\n*Required*  \nType: `string`\n\nThe command to run on each version.\n\n###### versions\n\n*Required*  \nType: `array[string]`\n\nVersions to install and run against.\n\n###### npm\n\nType: `boolean`  \nDefault: `false`\n\nSet to `true` to treat the command as an npm script.\n\n###### child_process\n\nType: `object`  \nDefault: `{}`\n\nOptions to pass to [spawned child processes](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).\n\n###### bail\n\nType: `boolean`  \nDefault: `false`\n\nCall the callback immediately with an error if any test fails.\n\n##### callback\n\n*Required*  \nType: `function`  \nArguments: `err, results`\n\nA callback to be called when the run completes. Installation errors are considered fatal, while test errors are only fatal when `options.bail` is set. \n\n###### results\n\nType: `array[object]`\n\nAn array of objects with properties *version* (string) and *passed* (boolean) indicating test results. \n\n## Events\n\nA script runner is an `EventEmitter` and emits various events during its lifecycle. These events are:\n\n* preinstall\n* postinstall\n* prescript\n* postscript\n* result\n* preuninstall\n* postuninstall\n\nAll events receive the current version as the first argument. *pre* events receive the child process used to execute the installation/script/uninstallation as the second argument. The *result* event receives the test result (pass/fail) as the second argument. *post* events receive only one argument.\n\n```js\nrun(config, callback)\n  .on('postinstall', function (version) {\n    console.log('Installed', version)\n  })\n  .on('prescript', function (version, child) {\n    child.stdout.pipe(process.stdout)\n  })\n```\n\nNote that you can use `{stdio: 'inherit'}` in the `child_process` option if you'd prefer to pass through all output (install and uninstall logs), not just the script. \n\n## License\n\nMIT © [Ben Drucker](http://bendrucker.me)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Frun-versions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendrucker%2Frun-versions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Frun-versions/lists"}