{"id":20285757,"url":"https://github.com/tpkn/page-check","last_synced_at":"2026-05-07T22:41:47.206Z","repository":{"id":57318007,"uuid":"122760708","full_name":"tpkn/page-check","owner":"tpkn","description":"Webpage tester based on Puppeteer and Node.js","archived":false,"fork":false,"pushed_at":"2019-07-16T13:37:36.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T14:41:19.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/tpkn.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":"2018-02-24T17:04:38.000Z","updated_at":"2019-07-16T13:37:38.000Z","dependencies_parsed_at":"2022-08-25T20:40:25.790Z","dependency_job_id":null,"html_url":"https://github.com/tpkn/page-check","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/tpkn%2Fpage-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fpage-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fpage-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fpage-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpkn","download_url":"https://codeload.github.com/tpkn/page-check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241780512,"owners_count":20019061,"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-14T14:28:47.690Z","updated_at":"2025-12-02T01:03:49.798Z","avatar_url":"https://github.com/tpkn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Page Check [![npm Package](https://img.shields.io/npm/v/page-check.svg)](https://www.npmjs.org/package/page-check)\nWebpage tester based on Puppeteer and Node.js\n\n\n\nModule runs your webpage, app or banner within virtual browser. While running, it registers next few things:\n- javascript errors (including errors inside `onresize` handler)\n- missing files\n- console events (`log`, `warn`, etc.)\n- requests to a different hosts\n\n\n\n## Installation\n```bash\nnpm install page-check\n```\n\n\n\n## API\n\n### PageCheck(input[, options])\n\n### input   \n**Type**: _String_ | _Array_   \n\n\n### options.timeout \n**Type**: _Number_   \n**Default**: `60`     \nKeep checking for this amout of seconds\n\n\n### options.clones\n**Type**: _Boolean_   \n**Default**: `false`     \nIf set to `false`, the same errors will be removed from the list\n\n\n### options.filter   \n**Type**: _Function_     \nThis function will be used by `Array.filter()` to filter final list of errors.     \nFor example we could leave only `js errors` and `external request`:    \n\nHere is the codes for quick filtering:\n\n| Code | Event |\n| :------: | ------ |\n| 1 | page error |\n| 2 | failed request |\n| 3 | external request |\n| 4 | iframe attached |\n| 6 | console.log |\n| 7 | console.error |\n| 8 | console.warn, console.info ... |\n| 9 | dialog, alert ... | \n| 10 | not existing page or any else errors | \n\n\n\n### options.args    \n**Type**: _Array_   \nArray of arguments that would be passed into `puppeteer.launch(args)`\n\n\n\n### options.spoof_list    \n**Type**: _Array_   \nList of requests that should be replaced. For example, you don't want to wait until some heavy library is downloaded from remote server:\n\n```javascript\nPageCheck(page_url, {\n   args: [ '--disable-web-security' ],\n   spoof_list: [\n      { \n         rule: 'https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.8.2/pixi.js', \n         body: fs.readFileSync('./libs/pixi.js'), \n         status: 200, \n         contentType: 'text/plain'\n      }, \n   ]\n})\n```\n\n*Note:* set `args: [ '--disable-web-security' ]` if you have the CORS error\n\n\n\n### options.screenshot    \n**Type**: _Boolean_   \n**Default**: `false`  \n\n\n### options.screenshot.delay    \n**Type**: _Number_   \n**Default**: `3`  \nWait for this number of seconds before taking a screenshot\n\n\n\n### options.viewport    \n**Type**: _Object_   \n**Default**: `{ width: 1000, height: 600 }`  \n\n\n\n### options.headless    \n**Type**: _Boolean_     \n**Default**: `true`  \n\n\n### options.devtools    \n**Type**: _Boolean_   \n**Default**: `false`  \n\n\n\n\n## Usage\n```javascript\nconst PageCheck = require('page-check');\n\nlet results = await PageCheck('http://localhost/page', {\n   timeout: 15, \n   filter: err =\u003e /[1234]/.test(err.code), \n   screenshot: {\n      delay: 5,\n      path: `./screenshots/${Date.now()}.png`\n   }\n});\n\nconsole.log(results);\n```\n\n\n\n\n## Output\n```\n{\n  \"screenshot\": \u003cBuffer\u003e,\n  \"errors\": [\n    {\n      \"code\": 3,\n      \"type\": \"external request\",\n      \"details\": \"http://domain.com/favicon.ico\"\n    },\n    {\n      \"code\": 6,\n      \"type\": \"console.log\",\n      \"details\": \"Boop!\"\n    },\n    {\n      \"code\": 7,\n      \"type\": \"console.error\",\n      \"details\": \"Failed to load resource: the server responded with a status of 404 (Not Found)\"\n    }\n  ]\n}\n```\n\n\n\n\n\n## Changelog \n#### v3.1.0 (2018-11-18):\n- added ability to spoof page requests\n\n#### v3.0.2 (2018-11-22):\n- added 'iframe' error type for attached iframes\n\n#### v3.0.1 (2018-11-13):\n- removed `input` property from results data\n\n#### v3.0.0 (2018-11-11):\n- `input` argument now could be only a `String`\n- now you can take a screenshot of the testing page\n\n#### v2.1.1 (2018-09-21):\n- fixed `Unhandled promise rejection` when the browser was closing but 'setViewport' keep firing\n\n#### v2.1.0 (2018-08-30):\n- `input` now could be an array of links that would be auto queued\n\n#### v2.0.0 (2018-08-26):\n- moved from unmaintained PhantomJS to Puppeteer\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fpage-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpkn%2Fpage-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fpage-check/lists"}