# fautorouter

> Express Auto register route

Latest version **0.0.2** (published 2022-07-01) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-07-01 |
| First published | 2022-06-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jeffrey-mu |
| Maintainers | mr-wang1009 |
| Keywords | express |

## Links

- npm: https://www.npmjs.com/package/fautorouter
- Repository: https://github.com/Jeffrey-mu/autoRouter
- Homepage: https://github.com/Jeffrey-mu/autoRouter#readme
- Issues: https://github.com/Jeffrey-mu/autoRouter/issues
- npm.io page: https://npm.io/package/fautorouter

## Recent versions

- 0.0.2 (latest) — 2022-07-01
- 0.0.1 — 2022-06-30

## README

# fautorouter

- Use FS module to recursively find files and register JS files as routing components
- Create existing use

### Install

```shell
npm i fautorouter
```

### Usage

```js
const fautorouter = require("fautorouter");
let app = express();
let dir = path.join(__dirname, "/routes");
fautorouter(app, dir);
```

### Scene

before

```js
// app.js
const app = require("express")();
app.use('/login', login)
app.use('/user', user)
app.use('/role', role)
app.use('/data', data)
....
....
```

after

```js
// app.js
const app = require("express")();
const asyncCacheFn = require("fautorouter");
asyncCacheFn(app, dir);
....
```

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