{"id":18665767,"url":"https://github.com/emilhein/optifunc","last_synced_at":"2026-05-08T01:40:33.266Z","repository":{"id":51857221,"uuid":"131508873","full_name":"emilhein/optifunc","owner":"emilhein","description":"NPM module to make optimizations and tests on your functions","archived":false,"fork":false,"pushed_at":"2022-12-30T18:52:35.000Z","size":205,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T13:16:22.415Z","etag":null,"topics":["helper-functions","nodejs","npm","performance","statistics","testing"],"latest_commit_sha":null,"homepage":"","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/emilhein.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-04-29T16:05:30.000Z","updated_at":"2019-11-03T17:56:23.000Z","dependencies_parsed_at":"2023-01-31T13:30:34.397Z","dependency_job_id":null,"html_url":"https://github.com/emilhein/optifunc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilhein%2Foptifunc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilhein%2Foptifunc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilhein%2Foptifunc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilhein%2Foptifunc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emilhein","download_url":"https://codeload.github.com/emilhein/optifunc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239493706,"owners_count":19647995,"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":["helper-functions","nodejs","npm","performance","statistics","testing"],"created_at":"2024-11-07T08:29:02.372Z","updated_at":"2025-11-06T11:30:39.947Z","avatar_url":"https://github.com/emilhein.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Coverage Status](https://coveralls.io/repos/github/emilhein/optifunc/badge.svg?branch=master)](https://coveralls.io/github/emilhein/optifunc?branch=master)\r\n[![Build Status](https://travis-ci.org/emilhein/optifunc.svg?branch=master)](https://travis-ci.org/emilhein/optifunc)\r\n\r\n## What do i do\r\n\r\nFor now i only have two functions\r\n\r\n#### 1. compare(function1, function2, input1, input2, ...)\r\n\r\nsimple check if two functions return the same output\r\n\r\n#### 2. run([function1, function2, ...], input1, input2,input3, ...)\r\n\r\nrun x amount of functions with same input and out some execution time statistics.\r\n\r\n## basic usage\r\n\r\n```js\r\nlet { run, compare } = require(\"optifunc\");\r\n\r\nlet func1 = a =\u003e a;\r\nlet func2 = a =\u003e a;\r\n\r\ncompare({functions : [func1, func2], args: [\"Someinput\"] )\r\n    .then(res =\u003e run({ functions: [func1, func2] }))\r\n    .then(stats =\u003e {\r\n        console.log(stats);\r\n    });\r\n// Output\r\n// ​​​​​[ { function: 'func1', max: 0.034, min: 0.001, avg: '0.005' },​​​​​\r\n// ​​​​​  { function: 'func2', max: 0.001, min: 0.001, avg: '0.001' } ]​​​​​\r\n\r\n//Or only the run function\r\nrun({ functions: [func1, func2], runTimes: 20 }, \"test\").then(res =\u003e console.log(res));\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilhein%2Foptifunc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femilhein%2Foptifunc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilhein%2Foptifunc/lists"}