# @alexkmerz/tiny

> Smallest framework i can make

Latest version **1.0.2** (published 2021-09-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install @alexkmerz/tiny
pnpm add @alexkmerz/tiny
yarn add @alexkmerz/tiny
bun add @alexkmerz/tiny
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-09-15 |
| First published | 2021-09-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alex Merz |
| Maintainers | alexkmerz |
| Keywords | framework, tiny |

## Links

- npm: https://www.npmjs.com/package/@alexkmerz/tiny
- npm.io page: https://npm.io/package/@alexkmerz/tiny

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-09-15
- 1.0.1 — 2021-09-15
- 1.0.0 — 2021-09-13

## README

# Tiny

Smallest framework i can make

NOTE: Use at your own risk

---

## Http

Server routes and middleware

```javascript
import { app, listen } from '@alexkmerz/tiny'

app.middleware('world', async (req, res) => {
  const forbidden = Math.random() < 0.5
  if (forbidden) {
    res.writeHead(404)
    return res.end('Forbidden')
  }
})

app.get('/hello', async (req, res) => {
  res.writeHead(200)
  return res.end('Hello World')
})

listen(8080)
```

---

## Bus

```javascript
import { bus } from '@alexkmerz/tiny'

bus.on('event', async () => {
  console.log('event)
})
bus.emit('event')
```

---

## Schedule

```javascript
import { bus, register } from '@alexkmerz/tiny'

bus.on('scheduler ready', () => register('event', 5000))
bus.on('event', () => {
  console.log('event')
})

```

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