# ifate

> An Object-Oriented node mvc and REST framework

Latest version **1.0.0** (published 2020-11-05) · Apache-2.0 license · 0 weekly downloads

## Install

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

Provides the command `_fate`.

## 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 | 2020-11-05 |
| First published | 2020-11-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 145.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | afu |
| Maintainers | solipu |
| Keywords | node, mvc, REST, api, framework |

## Links

- npm: https://www.npmjs.com/package/ifate
- Homepage: https://github.com/afuafuyo/ifate
- npm.io page: https://npm.io/package/ifate

## Dependencies (1)

- [fast-regexp-router](https://npm.io/package/fast-regexp-router.md) ^1.1.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-11-05

## README

# 一个面向对象的高效 node.js mvc and REST 框架

### Node 版本

+ 大于等于 8.0.0

### 源码 source code

+ https://github.com/afuafuyo/ifate

### 说明

ifate 是从 ynode 更名而来的项目

### 为什么是 IFate

+ IFate 实现了 MVC (Model-View-Controller) 设计模式并基于该模式组织代码

+ IFate 实现了自动路由映射

+ IFate 高可扩展和高可配置

+ IFate 的代码简洁优雅 这是它的编程哲学

### 示例 Hello world

使用 IFate 你只需要从一个入口文件开始，入口文件的内容可以使用自带的工具来生成，详情参见 doc 目录中的文档

```javascript
var IFate = require('ifate');
var App = require('ifate/web/Application');

var app = new App({
    'id': 1,

    // 定义调试应用
    'debug': true,

    // 定义应用路径
    'appPath': __dirname + '/app'

});

new IFate(app).listen(8090, function(){
    console.log('listen on 8090');
});
```

### 系统内置别名

+ @fate  系统目录
+ @app  项目目录 由 appPath 指定 `Fate.app.getAppPath()` 可得到该值
+ @runtime  缓存目录 默认指向 @app/runtime `Fate.app.getRuntimePath()` 可得到该值
+ @root  网站根目录 `Fate.app.getRootPath()` 可得到该值

### 项目目录示例

<pre>
|- index.js
|
|- node_modules 目录
|
|- public 目录
|
|- app 项目目录
|   |
|   |-- apis
|   |
|   |-- controllers 普通控制器目录
|       |
|       |-- user 用户组目录
|       |   |
|       |   |-- IndexController.js  - host:port/user/index 可以访问到该类
|       |   |-- OtherController.js  - host:port/user/other 可以访问到该类
|       |
|       |-- goods 商品组目录
|       |   |
|       |   |-- IndexController.js  - host:port/goods/index 可以访问到该类
|       |   |-- OtherController.js  - host:port/goods/other 可以访问到该类
|       |
|   -- views 普通控制器模板目录
|       |
|       |-- user 用户组模板 对应上面用户组
|       |   |
|       |   |-- index.html
|       |   |-- other.html
|       |
|   -- goods 商品组模板
|       |   |
|       |   |-- index.html
|       |   |-- other.html
|       |
|   -- modules 模块
|       |
|       |-- reg
|       |   |
|       |   |-- controllers 模块控制器目录 其下无子目录
|       |   |   |
|       |   |   |-- IndexController.js
|       |   |
|       |   |-- views 模块模板目录
|       |   |   |
|       |   |   |-- index.html
|       |   |
|       |   |-- 其他目录
|       |
|   -- runtime 缓存目录
|
</pre>

### 版本更新

+ 2020-11-05

    * 从 ynode 更名

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