npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fis3-command-r

v1.0.10

Published

fis/fekey r command extend command release.

Readme

fis3-command-r

继承fis3 release,新增参数-m。在FIS发布(deploy)过程中,读取rapx-mock.conf按一定的插入规则对相应的模板文件插入Mock插件代码

优势

可定制化地统一管理项目工程目录下的mock规则,相比直接插入mock规则代码,对业务代码无污染

开始使用

仅限百度外卖内部结合RAPX使用,兼容fekey

  1. 全局安装插件

npm install -g fis3-command-r

  1. 在工程目录下初始化生成一个rapx-mock.conf

fis3 r --init

fekey r --init

  1. 编写mock规则,使用fis3 r [media name] -m (fis3 r 是fis3 release的继承版,新增参数-m), 读取相应的rapx-mock.conf配置,完成mock代码的插入

原理

匹配相应的模板文件(如xxx.tpl)的文本内容,并在发布的过程中,对每个命中的执行tplContent.replace(regExpString, '$1$2{mockCode}$3'), 插入{mockCode} 默认是在{%block name='top-head-extend'%}和{%/block%}中插入Mock代码{mockCode}

命令行相关参数

 Options:

   -m, --mock       读取根木录下rapx-mock.conf,根据相应正则,动态插入插件代码到 指定tpl 中
  --init            在根目录下,初始化一个rapx-mock.conf模板文件
  --reset           重置被替换的smarty plugin(与参数-m同时使用)

rapx-mock.conf规则

可接受的操作符

mock, vue,vueResource, axios, insertFileExt, replace。其中replace与insertFileExt有默认值,可不设置

|操作符|语法||含义/参数释义|默认值| |----|------|----|----|---| |mock|mock {tplPath} {mockCode}||将Mock插件代码{mockCode} 插入到需要插入的文件(当前目录绝对路径{tplPath}) 需要插入的文本|| | ||{tplPath} |需要插入的tpl文件路径, 如 “/page/index.tpl”|| | ||{mockCode}|从RAPX平台上复制下来的Mock插件代码,如“{%require src="htt://avalon.inwaimai.baidu.com:8888/rap.plugin.js?projectId=1" type="js"%}”|| |vue|vue {vuePath}||如果需要支持vueResource的Mock扩展,需要将其模块地址声明于此|| |pluginPath|pluginPath {path}||如果项目不支持require src的fis3-require插件,并且fis-conf未声明plugin的远端推送地址,需在此指定|| |vueResource|vueResource {vueResourcePath}||如果需要支持vueResource的Mock扩展,需要将其模块地址声明于此(与vue声明一起)|| |axios|axios {axiosPath}||如果需要支持axios的Mock扩展,需要将其模块地址声明于此(与vue声明一起)|| | || {axiosPath}|mod.js require 引入的模块地址 如: nerve_common:static/js/axios.js|| |insertFileExt|insertFileExt {Ext}||声明需要匹配的模板文件格式,默认为.tpl|| | || {Ext}|需要支持的模板文件后缀,如有多个,用空格隔开。如:.tpl .html|.tpl| |replace|replace {regExpString}||匹配所有所需插入的文件 的替换正则。regExpString有三个捕获项($1$2$3),内部将执行tplContent.replace(regExpString, '$1$2{mockCode}$3'),其中{mockCode}为插入的文本内容, 默认插入到{%block name='top-head-extend'%}和{%/block%}中|| ||| {regExpString}||默认值如下|

replace (\{%\s*block\s*name\=[\"|\']top-head-extend[\"|\']%\})((?:(?!\{%\/\s*block).|\n)*)(\{%\/\s*block\s*%\})

示例

# pluginPath /home/map/odp_xxx/php/phplib/ext/smarty
# replace (\{%\s*block\s*name\=[\"|\']top-head-extend[\"|\']%\})((?:(?!\{%\/\s*block).|\n)*)(\{%\/\s*block\s*%\})
# insertFileExt .tpl .html .xxx
# mock /page/index.tpl {%require src="http://avalon.inwaimai.baidu.com:8888/rap.plugin.js?projectId=1" type="js"%}
# mock /page/index2.tpl {%require src="http://avalon.inwaimai.baidu.com:8888/rap.plugin.js?projectId=2" type="js"%}