# handle-file

> A simple function for serving static files from a "public" folder

Latest version **1.0.0** (published 2017-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install handle-file
pnpm add handle-file
yarn add handle-file
bun add handle-file
```

## 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.0 |
| Published | 2017-04-14 |
| First published | 2017-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Benjamin Collins |
| Maintainers | kion |
| Keywords | handle, file, server, http |

## Links

- npm: https://www.npmjs.com/package/handle-file
- npm.io page: https://npm.io/package/handle-file

## Dependencies (2)

- [mime](https://npm.io/package/mime.md) ^1.3.4
- [async](https://npm.io/package/async.md) ^2.3.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-04-14

## README

## handle-file

An example function for servind static files from a "public" folder located in the directory.

### Example:
```
"use strict";

const http = require("http");
const handleFile = require("handle-file");

const server = http.createServer();
server.on("request", handleRequest);
server.listen(8080, handleListen);

function handleRequest(req, res) {

	handleFile(req, res);

}

function handleListen() {
	
	console.log("Server is listening on port 8080");

}
```

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