{"id":19012229,"url":"https://github.com/binaryify/express-middleware-seo","last_synced_at":"2025-06-14T07:35:40.396Z","repository":{"id":74334545,"uuid":"95952890","full_name":"Binaryify/express-middleware-seo","owner":"Binaryify","description":"Webpage pre-rendering middleware, base on headless chrome⚡️","archived":false,"fork":false,"pushed_at":"2018-05-17T06:14:51.000Z","size":56,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-17T16:03:53.065Z","etag":null,"topics":["chrome","crawler","express","express-middleware","nodejs","seo"],"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/Binaryify.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,"zenodo":null}},"created_at":"2017-07-01T08:47:38.000Z","updated_at":"2021-12-31T09:37:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"be7594c3-c27f-45ab-84b6-eb5ac80f4bb6","html_url":"https://github.com/Binaryify/express-middleware-seo","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/Binaryify%2Fexpress-middleware-seo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Binaryify%2Fexpress-middleware-seo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Binaryify%2Fexpress-middleware-seo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Binaryify%2Fexpress-middleware-seo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Binaryify","download_url":"https://codeload.github.com/Binaryify/express-middleware-seo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250339667,"owners_count":21414398,"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":["chrome","crawler","express","express-middleware","nodejs","seo"],"created_at":"2024-11-08T19:17:12.414Z","updated_at":"2025-04-22T23:28:47.473Z","avatar_url":"https://github.com/Binaryify.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Npm Package](https://img.shields.io/npm/v/express-middleware-seo.svg?style=flat-square)](https://www.npmjs.com/package/express-middleware-seo)\n[![Npm Downloads](http://img.shields.io/npm/dm/express-middleware-seo.svg?style=flat-square)](https://www.npmjs.com/package/express-middleware-seo)\n[![Dependency Status](https://david-dm.org/binaryify/express-middleware-seo.svg?style=flat-square)](https://npmjs.org/package/express-middleware-seo)\n[![travis-ci](https://api.travis-ci.org/Binaryify/express-middleware-seo.svg?branch=master)](https://travis-ci.org/Binaryify/express-middleware-seo#)\n\n# express-middleware-seo\nSEO middleware for express base on [chrome-render](https://github.com/gwuhaolin/chrome-render), a substitute for [prerender](https://prerender.io).\n\nModern web app use technique like react.js vue.js which render html in browser, this lead to search engine can't crawl your page content.\n\nThis project want to solve this kind of problem in a general-purpose way, it detect request is from search engine crawler then use headless chrome to render out your modern web page and return to crawler.\n\nHere is express-middleware-seo's architecture diagram:\n![express-middleware-seo arch](./imgs/arch.png)\n\n## Use\n```bash\nnpm i express-middleware-seo\n```\nthen use it:\n```js\nconst express = require('express')\nconst path = require('path')\nconst app = express()\nconst { seoMiddleware } = require('express-middleware-seo')\n\napp.use(\n  seoMiddleware({\n    enable: true,\n    render: {\n      useReady: true,\n      renderTimeout: 10000\n    }\n  })\n)\n\napp.use(express.static(__dirname + '/static'))\n\napp.listen(3000)\n```\nyou can download and run this [complete demo](./example)\n\n## Notice\nYou should install Chrome 59+ in your servers before you use this middleware\n\n## Options\noptions come form [chrome-render](https://github.com/gwuhaolin/chrome-render#chromerendernew-method-support-options)\n- `maxTab`: `number` max tab chrome will open to render pages, default is no limit, `maxTab` used to avoid open to many tab lead to chrome crash. `ChromeRender` will create a tab poll to reuse tab for performance improve and resource reduce as open and close tab in chrome require time, like database connection poll. \n- `renderTimeout`: `number` in ms, `chromeRender.render()` will throw error if html string can't be resolved after `renderTimeout`, default is 5000ms.\n- `useReady`: `boolean` whether use `window.isPageReady=1` to notify chrome-render page has ready. default is false chrome-render use `domContentEventFired` as page has ready.\n- `script`: `string` is an option param. inject script source to evaluate when page on load\n\n## Friends\n- [chrome-render](https://github.com/gwuhaolin/chrome-render) general server render base on chrome.\n- [chrome-pool](https://github.com/gwuhaolin/chrome-pool) Headless chrome tabs manage pool.\n- [koa-chrome-render](https://github.com/gwuhaolin/koa-chrome-render) chrome-render middleware for koa\n- [koa-seo](https://github.com/gwuhaolin/koa-seo) koa SEO middleware","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinaryify%2Fexpress-middleware-seo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinaryify%2Fexpress-middleware-seo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinaryify%2Fexpress-middleware-seo/lists"}