# hyperf-reload

> 开发环境监听文件变化，自动重启 Hyperf-Service

Latest version **0.9.3** (published 2019-11-11) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install hyperf-reload
pnpm add hyperf-reload
yarn add hyperf-reload
bun add hyperf-reload
```

Provides the command `hyperf-reload`.

## 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.9.3 |
| Published | 2019-11-11 |
| First published | 2019-10-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | maosong |
| Maintainers | maosong |
| Keywords | php, hyperf, reload, watch, filewatch |

## Links

- npm: https://www.npmjs.com/package/hyperf-reload
- Repository: https://github.com/maosong/hyperf-reload
- Homepage: https://github.com/maosong/hyperf-reload#readme
- Issues: https://github.com/maosong/hyperf-reload/issues
- npm.io page: https://npm.io/package/hyperf-reload

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [chokidar](https://npm.io/package/chokidar.md) ^3.2.1
- [commander](https://npm.io/package/commander.md) ^3.0.2
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^1.7.0

## Recent versions

- 0.9.3 (latest) — 2019-11-11
- 0.9.2 — 2019-10-07

## README

# Hyperf Reload

开发环境监听文件变化，自动重启 Hyperf-Service

⚠️当前版本仅在macos/linux测试通过，使用windows的同学欢迎试(cai)用(keng)，有问题请提交issue，会尽快调整。

## 安装

需要nodejs环境，对nodejs/npm不熟悉的同学请[移步此处](https://github.com/maosong/nodejs-install-uninsatll.git)，教你熟练掌握nodejs的安装与卸载。。。

### 1. NPM安装（推荐）

```bash
$ npm i hyperf-reload -g

$ hyperf-reload --help
```

### 2. 本地安装

```bash
$ git clone [repository] --depth=1
$ cd hyperf-reload
$ npm i

$ ./bin/hyperf-reload --help
```

## 用例

### 1. 基本

```bash
$ hyperf-reload /path/to/hyperf.php
```

### 2. 忽略指定文件(夹)的监听

默认忽略 `**/.*` `**/test/*` `**/runtime/*` `**/.idea/*` 可根据需要自定义。

```bash
$ hyperf-reload -i "**/docs/* **/.* **/test/* **/runtime/* **/.idea/*" /path/to/hyperf.php
```

⚠️ 规则请参考 [anymatch](https://www.npmjs.com/package/anymatch)

### 3. 监听多个文件夹

某些特殊情况，需要同时监听多个文件夹。

```bash
$ hyperf-reload /path/to/hyperf.php /path/to/resources1 /path/to/resources2 /path/to/resources3
```

## PhpStorm集成

菜单 > Run > Edit Configurations > Add > Node.js

- Working directory: 项目文件夹
- JavaScript file: /usr/local/node/bin/hyperf-reload
- Application parameters: 项目文件夹/bin/hyperf.php

## 命令行参数

```
$ hyperf-reload --help

Usage: hyperf-reload [options] <hyperf-file> [watch-dirs...]

开发环境监听文件变化，自动重启 Hyperf-Service

Options:
  -i, --ignored <files>  忽略指定文件(夹)的监听 (default: "**/.* **/vendor/** **/test/** **/runtime/**")
  -i, --php <filepath>   PHP执行文件路径 (default: "php")
  -d, --debug            是否显示调试信息
  -V, --version          output the version number
  -h, --help             output usage information
```

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