
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
express-middleware-seo
Advanced tools
express middleware for serving prerendered javascript-rendered pages for SEO
SEO middleware for express base on chrome-render, a substitute for prerender.
Modern 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.
This 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.
Here is express-middleware-seo's architecture diagram:
npm i express-middleware-seo
then use it:
const express = require('express')
const path = require('path')
const app = express()
const { seoMiddleware } = require('express-middleware-seo')
app.use(
seoMiddleware({
enable: true,
render: {
useReady: true,
renderTimeout: 10000
}
})
)
app.use(express.static(__dirname + '/static'))
app.listen(3000)
you can download and run this complete demo
You should install Chrome 59+ in your servers before you use this middleware
options come form chrome-render
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.renderTimeout
: number
in ms, chromeRender.render()
will throw error if html string can't be resolved after renderTimeout
, default is 5000ms.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.script
: string
is an option param. inject script source to evaluate when page on loadFAQs
express middleware for serving prerendered javascript-rendered pages for SEO
The npm package express-middleware-seo receives a total of 3 weekly downloads. As such, express-middleware-seo popularity was classified as not popular.
We found that express-middleware-seo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.