# ohp

> Overly-simple Hypertext Preprocessing

Latest version **1.0.1** (published 2018-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install ohp
pnpm add ohp
yarn add ohp
bun add ohp
```

Provides the command `ohp`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-09-09 |
| First published | 2018-09-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 19.4 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | alex@alexforan.com |
| Maintainers | forana |

## Links

- npm: https://www.npmjs.com/package/ohp
- Repository: https://github.com/forana/ohp
- Homepage: https://github.com/forana/ohp#readme
- Issues: https://github.com/forana/ohp/issues
- npm.io page: https://npm.io/package/ohp

## Dependencies (6)

- [ejs](https://npm.io/package/ejs.md) ^2.6.1
- [colors](https://npm.io/package/colors.md) ^1.3.2
- [moment](https://npm.io/package/moment.md) ^2.22.2
- [commander](https://npm.io/package/commander.md) ^2.17.1
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.20
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.26.0

## Recent versions

- 1.0.1 (latest) — 2018-09-09
- 0.0.2 — 2018-09-02
- 0.0.1 — 2018-09-02

## README

# ohp

A web framework of sorts to get you up and running quickly with minimal amounts of dynamic content. Pronounced 'ope', like the midwestern greeting to inanimate objects.

Think of this kind of like PHP. It's slightly less icky, even, and gets you to similar places.

## Why?

Every so often, I have an idea for a silly web-based project. The professional in me says that I should use whatever the current community favorite framework is. This almost always takes me to Node, which takes me to a 12-layer dip of convoluted frameworks and transpilers and polyshim endofunctors that, by the time I'm up to speed and gotten code working, I'm tired, I'm overcaffeinated, I'm frustrated, the day is ruined, and I never actually get back to my silly idea. The world needs more silly projects, so here's a silly project to make other silly projects easier.

## What is it _really_?

It's a simple node-based web server that can automatically render [EJS templates](http://ejs.co/). It's not fast and it's not pretty, but it works. I don't recommend running it in production (or really outside of an isolated container).

## Installation

You'll need [npm](https://www.npmjs.com/get-npm).

```sh
npm install -g ohp
```

## Running

```sh
ohp <path-to-file-root>
```

For example, to run the [hello-world example](https://github.com/forana/ohp/tree/master/examples/hello-world) from this root of this repo:

```sh
ohp examples/hello-world
```

For command-line options, run `ohp --help`.

## Running examples

Follow installation above. Clone this repo, then, from the root:

```sh
ohp examples/hello-world
```

If you don't want to install `ohp` globally, you can use [yarn](https://yarnpkg.com/en/docs/install/) instead:

```sh
yarn && yarn start examples/hello-world
```

Either way, navigate to `http://localhost:8080/` to check it out.

## Dynamic content

`ohp` bundles [EJS](http://ejs.co/) - any file ending with `.ejs` will be rendered as an EJS template (other files are just piped on through). Directories use `index.html.ejs`, `index.ejs`, or `index.html` in that order. Files can be requested without the `.ejs` extension and `ohp` will find them - for example, a request for `/example.html` will check if `/example.html.ejs` exists, and use it if it does.

## Logging

`ohp` logs to standard out. Pipe that somewhere else if you need it somewhere else.

## License

MIT

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