# pdf-preview-webapp

> A small web application that takes PDFs (and other media types) via POST an displays them

Latest version **0.1.1** (published 2017-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install pdf-preview-webapp
pnpm add pdf-preview-webapp
yarn add pdf-preview-webapp
bun add pdf-preview-webapp
```

## 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.1 |
| Published | 2017-09-13 |
| First published | 2017-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jonas Pommerening |
| Maintainers | jpommerening |

## Links

- npm: https://www.npmjs.com/package/pdf-preview-webapp
- npm.io page: https://npm.io/package/pdf-preview-webapp

## Dependencies (9)

- [react](https://npm.io/package/react.md) ^15.6.1
- [sockjs](https://npm.io/package/sockjs.md) ^0.3.18
- [express](https://npm.io/package/express.md) ^4.15.3
- [react-dom](https://npm.io/package/react-dom.md) ^15.6.1
- [react-pdf](https://npm.io/package/react-pdf.md) ^1.8.3
- [file-loader](https://npm.io/package/file-loader.md) ^0.11.2
- [font-awesome](https://npm.io/package/font-awesome.md) ^4.7.0
- [sockjs-client](https://npm.io/package/sockjs-client.md) ^1.1.4
- [stats-webpack-plugin](https://npm.io/package/stats-webpack-plugin.md) ^0.6.1

## Recent versions

- 0.1.1 (latest) — 2017-09-13
- 0.1.0 — 2017-09-13

## README

# pdf-preview-webapp

📄🔍 a small web application for previewing PDFs

[![early screenshot](docs/screenshot.png)](docs/screenshot.jpg)

## Usage

The repository covers multiple integration scenarios. It can be used as a standalone server, but it also exports an express/connect compatible middleware.

The standalone server is a simple [express.js][express] app. You can start it by running the `server.js` script (for example via `yarn start`).
The server listens on port 8000 by default, but this can be changed by setting the `PORT` environment variable.
In this case you do not need the `devDependencies` which `yarn install` helpfully ignores when exporting `NODE_ENV=production`.

```console
$ export NODE_ENV=production PORT=8099
$ yarn install
$ yarn start
```

You can also `require( 'pdf-preview-webapp' )` to mount the application inside another express application. (Express [supports](http://expressjs.com/en/4x/api.html#app.use) nested apps.)

```js
const express = require( 'express' );
const previewApp = require( 'pdf-preview-webapp' );

const app = express();
app.use( '/preview', previewApp );
```

To start a `webpack-dev-server` instance running the application (including server side rendering) use `yarn dev`. This requires `devDependencies` to be installed:

```console
$ export NODE_ENV=
$ yarn install
$ yarn dev
```

## What's what

The `dist` directory contains the files that make up the actual application.

- `server.js` the express middleware that pre-renders the application on the server and handles the HTTP requests
- `browser.js` the actual web application that runs in your browser, including dependencies
- `style.css` CSS for the web application
- `*.worker.js` the source file for the web worker that renders PDF files

## Options

_TBD_


[express]: http://expressjs.com
[webpack]: https://webpack.js.org

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