Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including ssrer with all npm packages installed. Try it out:

var ssrer = require("ssrer")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ssrer v0.2.0

Server-Side Rendering with a headless browser.

ssrer

Overview

ssrer is an abbreviation for Server-Side Renderer. ssrer sends a request with a headless browser called Puppeteer. Since it uses headless browser the requests from it can be treated just the same as requests from real users.

ssrer shows more power with ssrer-express-middleware in Node.js and Express environment.

How to Use

$ git clone git@github.com:cam-inc/ssrer.git
$ npm install .
$ PORT=3000 npm run start

http://localhost:3000/?url=https://google.com/ to get string fo HTML context.

Queries

namerequireddefaultdescription
urlyes-URI-encoded url of a website to scrape.
widthno1024width of viewport.
heightno768height of viewport.
timeoutno10000time in milliseconds to timeout.
waitUntilnonetworkidlenetworkidle or load can be passed. with networkidle, the page will be considered loaded when the network activity stays idle for a while. with load, the page will be considered loaded when HTML's load event is fired.
cachenotrueif false then ssrer doesn't use cache store.
disableRequestsnofalseif true then all requests other than type of Document will be aborted.

with Dockerfile

as an example.

$ docker build -t ssrer ./
$ docker run -it -p 3000:3000 ssrer
$ curl http://localhost:3000/\?url=https://google.com/

How to Develop

$ docker run -it -p 3000:3000 -v /host/path/to/ssrer/:/docker/ssrer/ ssrer npm run watch

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free