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 🙏

© 2024 – Pkg Stats / Ryan Hefner

fis3-parser-html-replaceurl

v0.2.0

Published

replace html files static url

Downloads

5

Readme

fis3-parser-html-replaceurl

html文件替换静态url

安装

npm install -g fis3-parser-html-replaceurl

版本

v0.0.1 替换html中的静态url

v0.1.0 将html中的注释文件删除(可自定义保留那些注释字眼),可对html文件进行压缩

v0.2.0 新增对js中关键字眼的替换

自定义函数名

fis.media('test')
    .match("*", {
        domain: "${domain_test}",
    })
    .match('{*.html,**/a.js}', {
      parser: fis.plugin('html-replaceurl', {
        newWords:{
          csdn_url:"http://blog.csdn.net",
          github_url:"https://github.com",
          fdc_img3_url:"http://img3.fdc.com.cn"
        },
        removeComments:true, //是否删除注释,默认false
        ignoreWords:['ko'], //删除注释时,需要过滤的字眼,主要排除模板引擎自带的注释
        minifier:true //是否压缩,默认false
      })
    });
  • newWords key为需要替换的字眼,value为替换后的string
  • removeComments 是否删除注释,默认false
  • ignoreWords 删除注释时,需要过滤的字眼,主要排除模板引擎自带的注释
  • minifier 是否压缩,默认false
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
  <meta charset="UTF-8">
  <title>个人中心</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width">
  <!-- <meta name="renderer" content="webkit|ie-comp|ie-stand"> -->
  <link rel="stylesheet" href="less/a.less">
  <!-- <link rel="stylesheet" href="fdc_img3_url/usercenter/css/common.css"> -->
  <link rel="stylesheet" href="fdc_img3_url/usercenter/css/home.css">
</head>
  <body>
    <!-- <p>sfhjshsd</p>  -->
    <!-- ko foreach:{data:activeData,as:"value"} -->
    <a class="main" href="github_url/shunzizhan">我的git主页</a>
    <a href="csdn_url/u011613356/article/details/51914528">knockout技术分享</a>
  <!-- 版权:END -->

  <!-- 版权:END -->
  <!--<script src="js/a.js"></script>-->
  <script src="fdc_img3_url/usercenter/js/home.js"></script>
  </body>
</html>
<!DOCTYPE html><html class="no-js" lang="en"><head><meta charset="UTF-8"><title>个人中心</title><meta name="description" content=""><meta name="viewport" content="width=device-width"><meta name="renderer" content="webkit|ie-comp|ie-stand"><link rel="shortcut icon" href="/images/favicon.ico"><link rel="stylesheet" href="/css/a_0d7e657.css"><link rel="stylesheet" href="http://img3.fdc.com.cn/usercenter/css/common.css"><link rel="stylesheet" href="http://img3.fdc.com.cn/usercenter/css/home.css"></head><body><!-- ko foreach:{data:activeData,as:"value"} --><a class="main" href="https://github.com/shunzizhan"     >我的git主页</a><a href="http://blog.csdn.net/u011613356/article/details/51914528">knockout技术分享</a><script src="/js/a_7e347e2.js"></script><script src="http://img3.fdc.com.cn/usercenter/js/home.js"></script><script type="text/javascript" charset="utf-8" src="http://192.168.20.36:8134/livereload.js"></script></body></html>