# mat-old

> mat兼容的老版本

Latest version **1.0.4** (published 2020-05-06) · 0 weekly downloads

## Install

```sh
npm install mat-old
pnpm add mat-old
yarn add mat-old
bun add mat-old
```

Provides the command `mat-old`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2020-05-06 |
| First published | 2020-04-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 21 |
| Unpacked size | 24.3 KB |
| Known vulnerabilities | 0 (+20 in 7 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | naij |
| Maintainers | chongzhi |

## Links

- npm: https://www.npmjs.com/package/mat-old
- Repository: https://github.com/matjs/mat
- Issues: https://github.com/matjs/mat/issues
- npm.io page: https://npm.io/package/mat-old

## Dependencies (21)

- [co](https://npm.io/package/co.md) ^4.0.1
- [mz](https://npm.io/package/mz.md) 1.3.0
- [qs](https://npm.io/package/qs.md) 6.5.1
- [koa](https://npm.io/package/koa.md) 2.3.0
- [chalk](https://npm.io/package/chalk.md) 1.0.0
- [debug](https://npm.io/package/debug.md) 2.2.0
- [lodash](https://npm.io/package/lodash.md) 3.2.0
- [moment](https://npm.io/package/moment.md) 2.10.3
- [semver](https://npm.io/package/semver.md) 4.3.1
- [co-body](https://npm.io/package/co-body.md) 5.1.1
- [liftoff](https://npm.io/package/liftoff.md) 2.3.0
- [tildify](https://npm.io/package/tildify.md) 1.0.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [koa-send](https://npm.io/package/koa-send.md) 1.3.1
- [minimist](https://npm.io/package/minimist.md) 1.1.1
- [thunkify](https://npm.io/package/thunkify.md) 2.1.2
- [co-request](https://npm.io/package/co-request.md) 0.2.1
- [koa-compose](https://npm.io/package/koa-compose.md) 2.3.0
- [koa-convert](https://npm.io/package/koa-convert.md) 1.2.0
- [safe-buffer](https://npm.io/package/safe-buffer.md) ^5.1.1
- [orchestrator](https://npm.io/package/orchestrator.md) 0.3.7

## Recent versions

- 1.0.4 (latest) — 2020-05-06
- 1.0.3 — 2020-05-06
- 1.0.2 — 2020-05-06
- 1.0.1 — 2020-05-06
- 1.0.0 — 2020-05-06
- 1.0.15 — 2020-04-07
- 1.0.14 — 2020-04-07
- 1.0.13 — 2020-04-07
- 1.0.12 — 2020-04-07

## README

# mat

[![npm version](https://badge.fury.io/js/mat.svg)](http://badge.fury.io/js/mat)

## 文档

详细文档请查看[matjs官方网站](http://matjs.com/)

## 一个简单的matfile例子

```javascript
var mat  = require('mat')
var proxy = require('mat-proxy')

// 反向代理
mat.task('daily', function () {
  mat.url([/\.json/])
    .use(proxy({
      proxyPass: 'your.proxy.host'
    }))
})

// url重写
mat.task('online', function () {
  mat.url([/\.js/])
    .rewrite([
      [/-min\.js/g, '.js']
    ])
})

// combo url handler
mat.task('combohandler', function () {
  // 开启对combo url的支持
  mat.env({
    combohandler: true
  })

  // 将所有的-min结尾的js重写，去掉-min
  // 并且所有combo的js都会被拆开，分别从本地获取
  // mat会组装这些js，并最终返回一个合并过的js
  mat.url([/\.js/])
    .rewrite([
      [/onlinepath/, 'localpath'],
      [/-min/g, '']
    ])
})
```

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