0.10.0 • Public • Published


Linux Build Windows Build Test Coverage Code Climate Downloads Version Dependency Status

This is a load testing library and CLI tool. It is inspired by the good parts of Vegeta and JMeter, but hopefully leaves out the bad parts of both.


You can install grandma as a global CLI tool:

npm install grandma

Test files

Here is a quick example of a test file:

module.exports = {
    beforeAll: function(done) {
    beforeEach: function(done) {
    test: function(done) {
    afterEach: function(done) {
    afterAll: function(done) {

All functions other than test are optional, and you can exclude them if you do not need them. All functions are asynchronous, and you must call the done callback to continue. For more information about writing tests, see the test files help topic.


To see the most up-to-date CLI, type:

grandma help

The following commands are available.

grandma run <testname> --duration=<duration> --rate=<rate> [options]
grandma report [glob=stdin] [options]
grandma list [options]

To see help on these commands, you can type one of:

grandma run --help
grandma report --help

The following options are available as flags (some are only relevant for the run command):

grandma list

Lists all the tests in your test suite. You can use these names in grandma run to run the test. See more information bout it in the granda list CLI page.

grandma run

Run a test named "pineapples" for 10 minutes at a rate of 500 tests per second:

grandma run pineapples --duration 10m --rate 500 --out pineapples.log

Run a test named "peaches" for one and a half hours, running 100 concurrent tests:

grandma run peaches --duration 1h30m --concurrent 100 --out peaches.log

To find out more about the CLI, please see the grandma run CLI page.

Note: I will assume that you have configured the test directory in the .grandmarc file, so it was not included it in these examples.

grandma report

Print a plain text report of the previously-described test run:

grandma report pineapples.log

You can also create an HTML page containing an interactive graph of the results:

grandma report pineapples.log --type html --out pineapples.html

By default, all reports will print to standard output, unless you specify a file in the --out flag.

You can find more information about the available reports and the data they provide in the grandma report CLI page.

grandma diff

Compares two or more test runs, calculating the difference in timing among them.

grandma diff --logs one.log two.log three.log

.grandmarc file

You can set up an RC file to help with managing some of the setting, such as the directory of test files. Here is the content a sample file.

To find out more, see the .grandmarc doc page.


Grandma exposes the run and report commands as an API.

var grandma = require('grandma');

See more information about using run in the API page.

See more information about using report in the API page.

Package Sidebar


npm i grandma

Weekly Downloads






Unpacked Size

169 kB

Total Files


Last publish


  • kirilv