{"id":20962989,"url":"https://github.com/doesdev/ops-per-sec","last_synced_at":"2025-10-20T05:28:30.230Z","repository":{"id":57315769,"uuid":"100450404","full_name":"doesdev/ops-per-sec","owner":"doesdev","description":"Quickly test ops per second of a function","archived":false,"fork":false,"pushed_at":"2020-02-11T03:31:40.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T23:34:12.404Z","etag":null,"topics":[],"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/doesdev.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":"2017-08-16T05:19:38.000Z","updated_at":"2020-02-11T03:31:19.000Z","dependencies_parsed_at":"2022-08-25T20:40:36.241Z","dependency_job_id":null,"html_url":"https://github.com/doesdev/ops-per-sec","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/doesdev/ops-per-sec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fops-per-sec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fops-per-sec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fops-per-sec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fops-per-sec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doesdev","download_url":"https://codeload.github.com/doesdev/ops-per-sec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fops-per-sec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259364915,"owners_count":22846579,"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":[],"created_at":"2024-11-19T02:39:45.970Z","updated_at":"2025-10-20T05:28:25.212Z","avatar_url":"https://github.com/doesdev.png","language":"JavaScript","readme":"# ops-per-sec [![NPM version](https://badge.fury.io/js/ops-per-sec.svg)](https://npmjs.org/package/ops-per-sec)   [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)   \n\n\u003e Quickly test ops per second of a function\n\n## Warning - eval like stuff going on in cli yo\n\nWhen using the cli your string will be interpreted using Node's `vm` in a\nsandboxed context. I'm no expert on the dangers of that, but it's always better\nto be safe than sorry. Don't be dumb with that.\n\n\u003e \"eval is evil\" - some smart dude\n\n## Install\n\nnode\n```sh\n$ npm install --save ops-per-sec\n```\n\ncli\n```sh\n$ npm install -g ops-per-sec\n```\n\n## Usage\n\n```js\nconst opsPerSec = require('ops-per-sec')\nlet ops = opsPerSec(() =\u003e ['some', 'text', 'in'].includes('text'), 3000, true)\nconsole.log(`${ops} ops/sec`)\n```\n\n```sh\n$ ops-per-sec \"() =\u003e ['some', 'text', 'in'].includes('text')\" 3000 true\n```\n\n## API\n\n#### `opsPerSec(*func, *expect, *runForMs)`\n\n- **func** *[function - required]* function to test ops per second for\n- **runForMs** *[integer - optional - default: 5000]* time in ms to let function run\n- **expect** *[optional]* value you expect to be returned from function\n\n## License\n\nMIT © [Andrew Carpenter](https://github.com/doesdev)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fops-per-sec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoesdev%2Fops-per-sec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fops-per-sec/lists"}