open-index/open-npm huggingface dataset:
npm package: @reinjs/rein-memory-cache
Description: The memory cache of rein
Author: reinjs
Latest version: 1.0.0

# @reinjs/rein-memory-cache

## Install

```shell
npm i @reinjs/rein-memory-cache
```

## Usage

see more: [https://www.npmjs.com/package/node-cache](https://www.npmjs.com/package/node-cache)

```javascript
app.memory.set('key', 'value');
ctx.memory.set('key', 'value');
// ...
```

# License

It is [MIT licensed](https://opensource.org/licenses/MIT).
npm package: @reinjs/rein-schedule
Description: project of reinjs
Author: reinjs
Latest version: 1.0.2

# rein-schedule

## Install

```shell
npm i @reinjs/rein-schedule
```

## Usage

在项目文件夹或者插件文件夹中会存在一个文件夹 `schedule`，下面所有的文件都将被认为是一个任务，任务必须存在2个属性或方法：

- **rule** `object`或者`string` 时间规则 参考 https://www.npmjs.com/package/node-schedule#cron-style-scheduling
- **task** `function` 执行逻辑

比如我们创建一个任务 `app/schedule/test/db.js`:

```javascript
const Schedule = require('@reinjs/rein-schedule');

module.exports = class DbSchedule extends Schedule {
  constructor(...args) {
    super(...args);
  }

  /**
   * 此属性可以直接用字符串表示
   * 比如 `return '0 17 ? * 0,4-6'`
   */
  rule() {
    const rule = new Schedule.RecurrenceRule();
    rule.dayOfWeek = [0, new Schedule.Range(4, 6)];
    rule.hour = 17;
    rule.minute = 0;
    return rule;
  }

  async task() {
    // this.app do something.
  }
}
```

- 获取方式 `app.schedule.test.db`，遵守`reinjs`约定都规范。
- 取消任务 `await app.schedule.test.db.cancel()`

> **注意** 此插件只允许使用在`agent`进程上

# License

It is [MIT licensed](https://opensource.org/licenses/MIT).
npm package: @reinjs/rein-static
Description: static resource of reinjs
Author: reinjs
Latest version: 1.0.0

# rein-static

## Install

```shell
npm i @reinjs/rein-static
```

## usage

基本配置请看 [https://www.npmjs.com/package/koa-static#options](https://www.npmjs.com/package/koa-static#options)

多个静态目录请将配置改成数组即可

关于HistoryApiFallback配置

- 如果配置直接为true，默认开启转移到定义的'index'属性上
- 如果多个匹配，以{from, to}的数组存在 @from: 匹配URI的规则 @to: 指向到哪个目录的地址 相对地址 相对于URL

# License

It is [MIT licensed](https://opensource.org/licenses/MIT).