{"id":24846273,"url":"https://github.com/mefistosss/performance-js-tests","last_synced_at":"2025-03-26T08:45:46.019Z","repository":{"id":57322123,"uuid":"219758737","full_name":"Mefistosss/performance-js-tests","owner":"Mefistosss","description":"Shows the average value of running js","archived":false,"fork":false,"pushed_at":"2019-11-05T17:28:10.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T11:20:04.573Z","etag":null,"topics":["performance","testing"],"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/Mefistosss.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":"2019-11-05T14:00:31.000Z","updated_at":"2019-11-08T15:06:44.000Z","dependencies_parsed_at":"2022-08-25T22:41:42.868Z","dependency_job_id":null,"html_url":"https://github.com/Mefistosss/performance-js-tests","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mefistosss%2Fperformance-js-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mefistosss%2Fperformance-js-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mefistosss%2Fperformance-js-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mefistosss%2Fperformance-js-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mefistosss","download_url":"https://codeload.github.com/Mefistosss/performance-js-tests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245623017,"owners_count":20645679,"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":["performance","testing"],"created_at":"2025-01-31T10:19:27.527Z","updated_at":"2025-03-26T08:45:45.996Z","avatar_url":"https://github.com/Mefistosss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# performance-js-tests\n\n## Install\n\n```\n$ npm install --save performance-js-tests\n```\n\n## Usage\n\n### testable.js\n```js\n// for example\nwindow.somethingHappened = (callback) =\u003e {\n    setTimeout(callback, 1000);\n};\n```\n\n### index.html\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n    \u003ctitle\u003e\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cscript type=\"text/javascript\"\u003e\n        const startTime = +new Date();\n    \u003c/script\u003e\n\n    \u003cscript type=\"text/javascript\" src=\"testable.js\"\u003e\u003c/script\u003e\n\n    \u003cscript type=\"text/javascript\"\u003e\n        somethingHappened(() =\u003e {\n            const currentTime = +new Date();\n            window.onCustomEvent({ type: 'timeStamp', data: currentTime - startTime });\n        });\n    \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### performance test\n```js\nconst performanceTests = require('performance-js-tests');\n\n(async() =\u003e {\n    await performanceTests({\n        puppeteer: {\n            htmlFile: 'index.html'\n        }\n    });\n})()\n```\nBrowser will launch 100 times and you can see average file download or performance of js in ms\n\n\n## Options\n\n```js\n{\n    // number of launched browsers\n    numberOfStarts: 100,\n\n    // maximum latency from the browser\n    waitingTime: 30000,\n\n    // koa\n    server: {\n        enable: true,\n        port: 3000,\n        baseDir: '.',\n\n        staticKoaOptions: {\n            // see link below\n        },\n\n        rewrite: {\n            // see link below\n        }\n    },\n\n    puppeteer: {\n        // will launch firefox-launch instead of chrome-launch\n        useFirefox: false,\n\n        // html file where js is launched\n        htmlFile: null,\n        launchOptions: {\n            // see link below\n        }\n    }\n}\n````\n\n[staticKoaOptions](https://github.com/koajs/static)\n[rewrite](https://github.com/koajs/rewrite)\n[launchOptions](https://github.com/GoogleChrome/puppeteer#default-runtime-settings)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefistosss%2Fperformance-js-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmefistosss%2Fperformance-js-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefistosss%2Fperformance-js-tests/lists"}