# smallstack-webpage-renderer

> Tiny server that renders a given url

Latest version **0.1.0** (published 2016-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install smallstack-webpage-renderer
pnpm add smallstack-webpage-renderer
yarn add smallstack-webpage-renderer
bun add smallstack-webpage-renderer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-09-18 |
| First published | 2016-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | smallstack.io |
| Maintainers | maxfriedmann |

## Links

- npm: https://www.npmjs.com/package/smallstack-webpage-renderer
- npm.io page: https://npm.io/package/smallstack-webpage-renderer

## Dependencies (3)

- [nodemon](https://npm.io/package/nodemon.md) ^1.10.2
- [nightmare](https://npm.io/package/nightmare.md) ^2.7.0
- [httpdispatcher](https://npm.io/package/httpdispatcher.md) ^1.0.0

## Recent versions

- 0.1.0 (latest) — 2016-09-18

## README

# smallstack-webpage-renderer
This is a tiny server that renders a given url and returns it as PNG image. At smallstack.io we use it to render previews of javascript enabled pages. 

**Note:** The server will always wait for window.prerenderReady=true to be set.


## How-to run
### via node
```npm install && npm run serve```

### via docker
``` docker run -p 80:80 -d smallstack/smallstack-webpage-renderer```


## How-to use
The tiny server has only one endpoint so far, which is ```/render```. Possible Parameters are : 

Parameter     | Optional  | Default Value       | Example               | Description
------------  | ------    | -------------       | -------               | -------------
url           | no        | -                   | https://smallstack.io | The url to be rendered
mobile        | yes       | false               | true                  | Sets useragent to iPhone and uses smaller screen size
width         | yes       | 1280 (mobile: 375)  | 3840                  | The browser width
height        | yes       | 800 (mobile: 677)   | 2160                  | The browser height
additionalWait| yes       | 100                 | 5000                  | additional ms to wait after page got loaded

### Example
http://localhost/render?url=https://smallstack.io&width=600&height=800&mobile=true&additionalWait=2000

---
_Source: https://npm.io/package/smallstack-webpage-renderer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
