{"id":15681680,"url":"https://github.com/jonschlinkert/benchmarked","last_synced_at":"2025-07-06T13:03:33.899Z","repository":{"id":22055915,"uuid":"25384750","full_name":"jonschlinkert/benchmarked","owner":"jonschlinkert","description":"Easily generate benchmarks from a glob of files. Wrapper for Benchmark.js.","archived":false,"fork":false,"pushed_at":"2020-04-01T00:05:42.000Z","size":51,"stargazers_count":10,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-16T18:54:05.914Z","etag":null,"topics":["bench","benchmark","benchmarking","benchmarks"],"latest_commit_sha":null,"homepage":null,"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/jonschlinkert.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}},"created_at":"2014-10-18T02:26:22.000Z","updated_at":"2022-09-20T01:44:50.000Z","dependencies_parsed_at":"2022-08-19T01:20:12.749Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/benchmarked","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fbenchmarked","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fbenchmarked/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fbenchmarked/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fbenchmarked/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/benchmarked/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252850547,"owners_count":21813978,"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":["bench","benchmark","benchmarking","benchmarks"],"created_at":"2024-10-03T16:58:26.863Z","updated_at":"2025-05-07T09:28:52.269Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# benchmarked [![NPM version](https://img.shields.io/npm/v/benchmarked.svg?style=flat)](https://www.npmjs.com/package/benchmarked) [![NPM monthly downloads](https://img.shields.io/npm/dm/benchmarked.svg?style=flat)](https://npmjs.org/package/benchmarked) [![NPM total downloads](https://img.shields.io/npm/dt/benchmarked.svg?style=flat)](https://npmjs.org/package/benchmarked) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/benchmarked.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/benchmarked)\n\n\u003e Easily generate benchmarks from a glob of files.\n\nFollow this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), for updates on this project and others.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save benchmarked\n```\n\nThis is an opinionated wrapper for [benchmarked.js](http://benchmarkjs.com/) to make it easier to do benchmarks using glob patterns. Concept is from [remarkable](https://github.com/jonschlinkert/remarkable/tree/master/benchmark)\n\n## Usage\n\n```js\nconst Suite = require('benchmarked');\nconst suite = new Suite({\n  cwd: 'benchmark', // optionally define a base directory for code and fixtures\n  fixtures: 'my-fixtures/*.txt', // path or glob pattern to fixtures\n  code: 'my-functions/*.js', // path or glob pattern to code files\n  format: function(benchmark) {\n    // optionally override default formatting.\n    // return a string.\n    // see examples/basic.js for a real example.\n  }\n});\n\n// run the benchmarks\nsuite.run();\n```\n\nSee the [examples](./example) to get a better understanding of how this works.\n\n## API\n\n### [Benchmarked](index.js#L41)\n\nCreate an instance of Benchmarked with the given `options`.\n\n**Params**\n\n* `options` **{Object}**\n\n**Example**\n\n```js\nconst suite = new Suite();\n```\n\n### [.addFixtures](index.js#L265)\n\nAdd fixtures to run benchmarks against.\n\n**Params**\n\n* `patterns` **{String|Array}**: Filepaths or glob patterns.\n* `options` **{Options}**\n\n**Example**\n\n```js\nbenchmarks.addFixtures('fixtures/*.txt');\n```\n\n### [.addCode](index.js#L281)\n\nSpecify the functions to be benchmarked.\n\n**Params**\n\n* `patterns` **{String|Array}**: Filepath(s) or glob patterns.\n* `options` **{Options}**\n\n**Example**\n\n```js\nbenchmarks.addCode('fixtures/*.txt');\n```\n\n### [.addSuite](index.js#L293)\n\nAdd benchmark suite to the given `fixture` file.\n\n**Params**\n\n* `fixture` **{Object}**: vinyl file object\n\n### [.run](index.js#L369)\n\nRun the benchmarks.\n\n**Params**\n\n* `options` **{Object}**\n* `cb` **{Function}**\n* `thisArg` **{Object}**\n\n**Example**\n\n```js\nbenchmarks.run();\n```\n\n## About\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [base-cli](https://www.npmjs.com/package/base-cli): Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a… [more](https://github.com/node-base/base-cli) | [homepage](https://github.com/node-base/base-cli \"Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a few plugins, like 'base-store', 'base-options' and 'base-data'.\")\n* [base-option](https://www.npmjs.com/package/base-option): Adds a few options methods to base, like `option`, `enable` and `disable`. See the readme… [more](https://github.com/node-base/base-option) | [homepage](https://github.com/node-base/base-option \"Adds a few options methods to base, like `option`, `enable` and `disable`. See the readme for the full API.\")\n* [base-pkg](https://www.npmjs.com/package/base-pkg): Plugin for adding a `pkg` method that exposes pkg-store to your base application. | [homepage](https://github.com/node-base/base-pkg \"Plugin for adding a `pkg` method that exposes pkg-store to your base application.\")\n* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base \"Framework for rapidly creating high quality node.js applications, using plugins like building blocks\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 41 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 7 | [elidoran](https://github.com/elidoran) |\n| 2 | [jamescostian](https://github.com/jamescostian) |\n| 1 | [leesei](https://github.com/leesei) |\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on September 11, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fbenchmarked","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fbenchmarked","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fbenchmarked/lists"}