# anywhere

> Run static file server anywhere

Latest version **1.7.0** (published 2025-11-13) · MIT license · 0 weekly downloads

## Install

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

Provides the command `anywhere`.

## Health

**Score 50/100 (C)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

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

## Facts

| | |
|---|---|
| Version | 1.7.0 |
| Published | 2025-11-13 |
| First published | 2012-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1032 |
| Author | Jackson Tian |
| Maintainers | jacksontian |
| Keywords | Static, file, server, Assets |

## Links

- npm: https://www.npmjs.com/package/anywhere
- Repository: https://github.com/JacksonTian/anywhere
- Issues: https://github.com/JacksonTian/anywhere/issues
- npm.io page: https://npm.io/package/anywhere

## Dependencies (8)

- [debug](https://npm.io/package/debug.md) ^4.3.4
- [connect](https://npm.io/package/connect.md) ^3.6.6
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.35
- [serve-index](https://npm.io/package/serve-index.md) ^1.9.1
- [serve-static](https://npm.io/package/serve-static.md) ^1.13.2
- [http-proxy-middleware](https://npm.io/package/http-proxy-middleware.md) ^3.0.5
- [connect-history-api-fallback](https://npm.io/package/connect-history-api-fallback.md) ^2.0.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.7.0 (latest) — 2025-11-13
- 1.6.0 — 2022-05-08
- 1.5.0 — 2018-02-18
- 1.4.0 — 2016-06-15
- 1.3.0 — 2016-05-20
- 1.2.0 — 2015-05-10
- 1.1.0 — 2014-10-24
- 1.0.0 — 2014-09-16
- 0.0.9 — 2014-08-27
- 0.0.8 — 2014-07-06
- 0.0.7 — 2014-07-04
- 0.0.6 — 2014-06-03
- 0.0.5 — 2014-05-09
- 0.0.4 — 2013-12-14
- 0.0.3 — 2013-10-08
- … 2 more at https://npm.io/package/anywhere/versions

## README

Anywhere 随启随用的静态文件服务器
==============================

![NPM Version](https://img.shields.io/npm/v/anywhere)
![NPM Downloads](https://img.shields.io/npm/dm/anywhere)

Running static file server anywhere. 随时随地将你的当前目录变成一个静态文件服务器的根目录。

## Installation

Install it as a command line tool via `npm -g`.

```sh
npm install anywhere -g
```

## Execution

```sh
$ anywhere
// or with port
$ anywhere -p 8000
// or start it but silent(don't open browser)
$ anywhere -s
// or with hostname
$ anywhere -h localhost -p 8888
// or with folder
$ anywhere -d ~/git/anywhere
// or enable html5 history
$ anywhere -f /index.html
```

## Help

```sh
$ anywhere --help
Usage:
  anywhere --help // print help information
  anywhere // 8000 as default port, current folder as root
  anywhere 8888 // 8888 as port
  anywhere -p 8989 // 8989 as port
  anywhere -s // don't open browser
  anywhere -h localhost // localhost as hostname
  anywhere -d /home // /home as root
  anywhere -f /index.html  // Enable html5 history,the index is /index.html
  anywhere --proxy http://localhost:7000/api // Support shorthand URL, webpack.config.js or customize config file
```

#### Proxy argvs

**Shorthand URL**

```
anywhere --proxy http://localhost:7000/api
                 \___________________/\___/
                              |         |
                           target    context
```

More about the [shorthand configuration](https://github.com/chimurai/http-proxy-middleware#shorthand).

**Webpack config**

```javascript
// webpack.config.js
module.exports = {
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:7000',
        changeOrigin: true
      }
    }
  }
}
```

**Customize config**

```javascript
// proxy.config.js
module.exports = {
  '/api': {
    target: 'http://localhost:7000',
    changeOrigin: true
  }
}
```

More proxy [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware#context-matching) help.

## Visit

```
http://localhost:8000
```

Automatically open default browser. 执行命令后，默认浏览器将为您自动打开主页。

## License

The MIT license.

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