# @kravc/http

> Minimal node.js HTTP server for web development

Latest version **0.5.2** (published 2026-03-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install @kravc/http
pnpm add @kravc/http
yarn add @kravc/http
bun add @kravc/http
```

Provides the command `http`.

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 0.5.2 |
| Published | 2026-03-09 |
| First published | 2020-06-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alexander Kravets |
| Maintainers | kravc |

## Links

- npm: https://www.npmjs.com/package/@kravc/http
- Repository: https://github.com/alexkravets/http
- Homepage: https://github.com/alexkravets/http#readme
- Issues: https://github.com/alexkravets/http/issues
- npm.io page: https://npm.io/package/@kravc/http

## Recent versions

- 0.5.2 (latest) — 2026-03-09
- 0.5.1 — 2026-03-02
- 0.5.0 — 2026-02-11
- 0.4.2 — 2023-01-06
- 0.4.1 — 2020-11-09
- 0.4.0 — 2020-06-19
- 0.3.0 — 2020-06-09

## README

# @kravc/http

Minimal `node.js` HTTP server for web development.

## API

Install:

```sh
npm i --save-dev @kravc/http
```

### Get started

```js
const { createServer } = require('@kravc/http')

await createServer(() => ({
  body:       JSON.stringify({ message: 'Hello, world!' }, null, 2),
  statusCode: 200
}))
```

### Integration

In case you have module that exports request handler method, e.g `./index.js`,
add `start` script to `package.json`:

```json
"scripts": {
  "start": "http"
}
```

Specify custom module name or port to start server on with options:

```json
"scripts": {
  "start": "http ./module.js 4000"
}
```

TypeScript is supported—use `index.ts` or any `.ts` file. Install `ts-node` in your project:

```sh
npm i ts-node
```

Example of the npm start script with `nodemon` support:

```json
"scripts": {
  "start": "NODE_PATH=./ nodemon -e js,yaml -w ./src --exec http"
}
```

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