{"id":25535948,"url":"https://github.com/posrix/prerender-seo","last_synced_at":"2025-07-26T11:39:35.312Z","repository":{"id":50958279,"uuid":"113332222","full_name":"posrix/prerender-seo","owner":"posrix","description":"Prerender Javascript rendered pages for SEO","archived":false,"fork":false,"pushed_at":"2024-06-18T05:21:15.000Z","size":246,"stargazers_count":11,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T10:42:45.291Z","etag":null,"topics":["phantomjs","prerender","react","vue"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/prerender-seo","language":"HTML","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/posrix.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-06T15:20:14.000Z","updated_at":"2019-10-18T10:50:16.000Z","dependencies_parsed_at":"2024-06-18T06:54:27.716Z","dependency_job_id":null,"html_url":"https://github.com/posrix/prerender-seo","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.050000000000000044","last_synced_commit":"bad24aa9c2555ead11c978d3846444da0ff7b9a7"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posrix%2Fprerender-seo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posrix%2Fprerender-seo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posrix%2Fprerender-seo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posrix%2Fprerender-seo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posrix","download_url":"https://codeload.github.com/posrix/prerender-seo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248250744,"owners_count":21072682,"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":["phantomjs","prerender","react","vue"],"created_at":"2025-02-20T04:24:31.691Z","updated_at":"2025-04-11T14:34:12.268Z","avatar_url":"https://github.com/posrix.png","language":"HTML","readme":"# prerender-seo\n\nPrerender HTML files using [Puppeteer](https://github.com/GoogleChrome/puppeteer).\n\n## Install\n\n```bash\nnpm i prerender-seo -D\n```\n\n## Usage\n\n``` js\nconst path = require('path')\nconst prerender = require('prerender-seo')\n\nconst files = [\n  '/index.html'\n]\n\nprerender(\n  path.resolve(__dirname, './dist'),\n  files,\n  {\n    // options\n  }\n)\n```\n\n## Test\n\nThe test case use a [vue-cli](https://github.com/vuejs/vue-cli) generated project\n\n``` bash\nnpm run test\n```\n\n## Options\n\n|Name|Type|Default|Description|\n|:--:|:--:|:-----:|:----------|\n|**`sourceDir`**|`{String}`|`-`|Source directory of static files|\n|**`files`**|`{Array}`|`-`|HTML Files to prerender|\n|**`options.destDir`**|`{String}`|`*_prerender`|Destination directory to store the result|\n|**`options.proxyTable`**|`{Array}`|`[]`|Proxy to forward any http request that match the config|\n|**`options.navigationTimeout`**|`{Number}`|`30000`|Define the timeout of any navigation operations|\n|**`options.resourceInterception`**|`{Array}`|`[]`|Define the regular expression of any resource will be aborted|\n\n### `sourceDir`\n\n```js\nprerender(\n  path.resolve(__dirname, '../dist')\n)\n```\n\n### `files`\n\n```js\nprerender(\n  files: [\n    'index.html',\n    'about.html',\n    'product.html'\n  ]\n)\n\n```\n### `options.destDir`\n\nDefine the destination directory. If you want to replace the source directory, just set the same path as `sourceDir`.\n\n```js\nprerender(\n  path.resolve(__dirname, '../dist'),\n  files: [\n    'index.html',\n    'about.html',\n    'product.html'\n  ],\n  {\n    destDir: path.resolve(__dirname, '../dist')\n  }\n)\n```\n\n### `options.proxyTable`\n\n```js\nprerender(\n  path.resolve(__dirname, '../dist'),\n  files: [\n    'index.html',\n    'about.html',\n    'product.html'\n  ],\n  {\n    proxyTable: {\n      context: '/api',\n      proxy: {\n        host: 'example.com',\n        port: '80',\n        protocol: 'http'\n      }\n    }\n  }\n)\n```\n\n\n### `options.navigationTimeout`\n\n Define the timeout after which any navigation operations will stop trying. (in milli-secs)\n\n```js\nprerender(\n  path.resolve(__dirname, '../dist'),\n  files: [\n    'index.html',\n    'about.html',\n    'product.html'\n  ],\n  {\n    navigationTimeout: 60000\n  }\n)\n```\n\n### `options.resourceInterception`\n\nDefine the regular expression to match any resource url will be aborted before request. The left hand in the array is `RegExp` pattern, the right hand is `RegExp` flag.\n\n```js\nprerender(\n  path.resolve(__dirname, '../dist'),\n  files: [\n    'index.html',\n    'about.html',\n    'product.html'\n  ],\n  {\n    resourceInterception: [\n      ['hm.baidu.com', 'g'],\n      ['/api/tokenAttach', 'g']\n    ]\n  }\n)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposrix%2Fprerender-seo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposrix%2Fprerender-seo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposrix%2Fprerender-seo/lists"}