# fastify-press

> Experimental SSG built with Fastify

Latest version **0.0.2** (published 2021-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install fastify-press
pnpm add fastify-press
yarn add fastify-press
bun add fastify-press
```

## 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.0.2 |
| Published | 2021-07-24 |
| First published | 2021-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | galvez |

## Links

- npm: https://www.npmjs.com/package/fastify-press
- Repository: https://github.com/terixjs/fastify-press
- Issues: https://github.com/terixjs/fastify-press/issues
- npm.io page: https://npm.io/package/fastify-press

## Dependencies (3)

- [klaw](https://npm.io/package/klaw.md) ^3.0.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [fastify-plugin](https://npm.io/package/fastify-plugin.md) ^3.0.0

## Recent versions

- 0.0.2 (latest) — 2021-07-24
- 0.0.1 — 2021-07-24

## README

# fastify-press

Experimental Static Site Generator (SSG) built with Fastify.

Right now it's just a proof of concept using a simple Markdown processor, with no proper client build.

That is, right now it's just generating HTMLs based on a list of URLs from the autoloaded entry files.

The goal is eventually integrate well to [fastify-vite](https://github.com/terixjs/fastify-vite).

## Usage

```js
async function main (fastify, options) {
  await fastify.register(require('fastify-press'))
  fastify.press.setProcessor((entry) => {
    entry.body = marked(entry.contents)
    return entry
  })
  fastify.press.addEntries(resolve(__dirname, 'entries'))
  fastify.press.build(({ add, done }) => {
    for (const { name } of values(fastify.press.entries)) {
      add(`/entries/${name}`)
    }
    done()
  })
  fastify.get('/entries/:entry', ({ params }) => {
    return fastify.press.entries[params.entry].body
  })
  await fastify.ready()
}
```

## License

MIT

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