
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
server-render
Advanced tools
HTML server rendering middleware. Detects if an incoming request is requesting
text/html and calls a function to render the corresponding response.
Assuming the client is a choo app:
const render = require('server-render')
const merry = require('merry')
const client = require('./client')
const app = merry()
app.use(render((route) => client.toString(route)))
app.start()
Sometimes you know the paths you're going to render up front, and want to cache them in a Node buffer so the reponse times are as fast as they can be.
const cache = require('server-render/cache')
const render = require('server-render')
const merry = require('merry')
const client = require('./client')
const routes = {
default: '/404',
routes: [ '/', '/bar', '/bar/baz', '/bar/:foobar' ]
}
const app = merry()
app.use(render(cache(routes, (route) => client.toString(route))))
app.start()
Create a new render function that takes a callback and returns a middleware
function. The callback should return a string synchronously. The middleware
function has the signature of (req, res, next).
Cache routes into a Node buffer. Takes an object containing a .routes array
of routes, and a .default value for the default route to match if no other
routes could be matched. Can be passed as the handler into render(handler)
to turn it into middleware.
$ npm install server-render
FAQs
HTML server rendering middleware
The npm package server-render receives a total of 0 weekly downloads. As such, server-render popularity was classified as not popular.
We found that server-render demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.