Socket
Book a DemoInstallSign in
Socket

mat

Package Overview
Dependencies
Maintainers
4
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mat

一个简单命令行工具,提供基础的任务和代理功能

1.0.23
latest
Source
npmnpm
Version published
Weekly downloads
45
-58.72%
Maintainers
4
Weekly downloads
 
Created
Source

mat

npm version

文档

详细文档请查看matjs官方网站

一个简单的matfile例子

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, '']
    ])
})

FAQs

Package last updated on 14 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.