# vitro

> Experimental Fetch API based web framework

Latest version **0.2.7** (published 2020-05-18) · MIT license · 0 weekly downloads

## Install

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

Provides the command `vitro`.

## 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.2.7 |
| Published | 2020-05-18 |
| First published | 2019-02-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 13.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ct0r |
| Maintainers | ct0r |
| Keywords | vitro |

## Links

- npm: https://www.npmjs.com/package/vitro
- Repository: https://github.com/ct0r/node-vitro
- Homepage: https://github.com/ct0r/node-vitro#readme
- Issues: https://github.com/ct0r/node-vitro/issues
- npm.io page: https://npm.io/package/vitro

## Dependencies (3)

- [arg](https://npm.io/package/arg.md) ^4.1.3
- [raw-body](https://npm.io/package/raw-body.md) ^2.4.1
- [content-type](https://npm.io/package/content-type.md) ^1.0.4

## Recent versions

- 0.2.7 (latest) — 2020-05-18
- 0.2.6 — 2020-05-17
- 0.2.5 — 2019-07-23
- 0.2.4 — 2019-05-13
- 0.2.3 — 2019-05-10
- 0.2.2 — 2019-05-10
- 0.2.1 — 2019-05-06
- 0.2.0 — 2019-05-06
- 0.1.10 — 2019-05-04
- 0.1.9 — 2019-05-04
- 0.1.8 — 2019-05-04
- 0.1.7 — 2019-04-30
- 0.1.6 — 2019-04-30
- 0.1.5 — 2019-04-26
- 0.1.2 — 2019-04-12
- … 1 more at https://npm.io/package/vitro/versions

## README

# vitro

[![Version](https://img.shields.io/npm/v/vitro.svg?style=flat-square)](https://www.npmjs.com/package/vitro)
[![Build](https://img.shields.io/circleci/project/github/ct0r/node-vitro/master.svg?style=flat-square)](https://circleci.com/gh/ct0r/node-vitro)
[![Coverage](https://img.shields.io/codeclimate/coverage/ct0r/node-vitro.svg?style=flat-square)](https://codeclimate.com/github/ct0r/node-vitro)
[![License](https://img.shields.io/github/license/ct0r/node-vitro.svg?style=flat-square)](https://github.com/ct0r/node-vitro/blob/master/LICENSE)

Experimental [Fetch API] based web framework.

[fetch api]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

## Installation

```
npm install vitro
```

## Usage

### CLI

Create an `index.js` file and export a function that accepts [Request] object and returns imported [Response] object (supports promises).

```js
const { Response } = require('vitro');

module.exports = request => new Response('Welcome to server, Fetch API!');
```

Add to you `package.json`:

```json
{
  "main": "index.js",
  "scripts": {
    "start": "vitro"
  }
}
```

Start server with:

```
npm start
```

Go to http://localhost:3000

Use `vitro --help` for more info.

### Programmatic use

```js
const vitro = require('vitro');
const { Response } = vitro;

const server = vitro(request => new Response('Welcome to server, Fetch API!'));

server.listen(3000);
```

Go to http://localhost:3000

[sw]: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
[request]: https://developer.mozilla.org/en-US/docs/Web/API/Request
[response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
[micro]: https://github.com/zeit/micro
[koa]: https://github.com/koajs/koa
[node-fetch]: https://github.com/bitinn/node-fetch

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