{"id":19886957,"url":"https://github.com/jbarabander/node-vegeta","last_synced_at":"2025-05-02T16:33:11.487Z","repository":{"id":44220204,"uuid":"133286941","full_name":"jbarabander/node-vegeta","owner":"jbarabander","description":"Vegeta for Node!","archived":false,"fork":false,"pushed_at":"2023-02-21T21:10:46.000Z","size":1648,"stargazers_count":8,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T23:18:47.957Z","etag":null,"topics":["load","load-testing","nodejs","vegeta"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbarabander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-14T00:53:50.000Z","updated_at":"2024-04-04T12:22:12.000Z","dependencies_parsed_at":"2023-01-25T15:01:32.443Z","dependency_job_id":null,"html_url":"https://github.com/jbarabander/node-vegeta","commit_stats":null,"previous_names":["jbarabander/scouter"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbarabander%2Fnode-vegeta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbarabander%2Fnode-vegeta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbarabander%2Fnode-vegeta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbarabander%2Fnode-vegeta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbarabander","download_url":"https://codeload.github.com/jbarabander/node-vegeta/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252072128,"owners_count":21690168,"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","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":["load","load-testing","nodejs","vegeta"],"created_at":"2024-11-12T17:40:02.482Z","updated_at":"2025-05-02T16:33:11.077Z","avatar_url":"https://github.com/jbarabander.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scouter\nVEGETA! WHAT DOES THE SCOUTER SAY ABOUT HIS POWER LEVEL?!?!\n\nnode.js bindings for the wonderful vegeta load-testing library.  See here: https://github.com/tsenart/vegeta\n\n## About\nVegeta is an awesome load-testing library.  It makes load testing super stress-free and is overall a real joy to use.  However, currently there doesn't seem to be a library allowing you to use vegeta in a javascript context.  This library sets out to change this by exposing the CLI implementation of vegeta in the node.js environment.\n\nNOTE: vegeta must be installed on your machine in order to use this library.  For help doing that see here: https://github.com/tsenart/vegeta#install\n\n## Installation\n```sh\nnpm install node-vegeta --save\n```\nor\n```sh\nyarn add node-vegeta\n```\n\n## Usage\n\n### Basic\nUsing node-vegeta is very similar to using vegeta via CLI.  All vegeta commands are supported via node classes like so:\n```js\nconst Attack = require('node-vegeta').Attack;\nconst testAttack = new Attack(); // spawns an attack command\ntestAttack\n    .targets('targets.txt')\n    .body('body.json')\n    .rate(9001) // ITS OVER NINE THOUSAND!!!\n    .duration('30s')\n    .report() // spawns the report command and pipes the results of the attack command to it\n    .process() // fires off the actual process\n    .stdout.on('data', (data) =\u003e {\n        console.log('report', data)\n    })\n```\nAll flags for `attack`, `encode`, `report`, and `plot` are also supported by the node interface.\n\n### Streaming\nThis library supports streaming from the get-go.  It should be very easy to integrate with the wonderful streaming\necosystem that nodejs supports\n\nExample:\n```js\nconst fs = require('fs');\nconst path = require('path');\nconst vegeta = require('node-vegeta');\nconst Attack = vegeta.Attack;\nconst Report = vegeta.Report;\nconst testAttack = new Attack();\nconst testReport = new Report();\nconst summaryStream = fs.createWriteStream(path.join(__dirname, 'summary.json'));\nconst resultsStream = fs.createWriteStream(path.join(__dirname, 'results.bin'));\nconst attackCommand = testAttack\n    .body(path.join(__dirname, 'body.json'))\n    .rate(500)\n    .duration('5s')\n    .process();\nconst reportCommand = testReport.type('json').process();\n\nattackCommand.stdin.setEncoding('utf-8');\nattackCommand.stdin.write('GET localhost:3000\\n'); // fire the attack to localhost:3000\nattackCommand.stdin.end();\n\nattackCommand.stdout.pipe(resultsFile);  // stream results to the results file\nattackCommand.stdout.pipe(reportCommand.stdin); // streams results to the report command\nreportCommand.stdout.pipe(summaryFile); // stream report to the summary file\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbarabander%2Fnode-vegeta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbarabander%2Fnode-vegeta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbarabander%2Fnode-vegeta/lists"}