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

bone-act-urlreplace

v0.0.5

Published

this is a act tools for bone to replace url from template or html.

Readme

bone-act-urlreplace

为bone开发的替换html文件中静态资源url的处理器

关于bone

bone 是一个高效的前端开发工具,它可以完成前端工程中相关的编译、压缩、版本控制、打包等相关工作,它同时具备实用的插件开发功能,可以自主开发处理器来完成自己的需求。详见文档 bone 新手入门

关于bone-act-urlreplace

为bone开发的处理器,可以按给定的规则替换模板文件或html中的静态资源,eg:

/static/images/demo.jpg => http://res1.cdn.com/static/images/demo_hash.jpg

安装

 npm install bone-act-urlreplace

使用

注:在此之前,你必须熟悉bone

// 通过bone加载
var bone = require('bone');
var urlreplace = bone.require('bone-act-re');
// 通过bone act 处理
bone.dest('js/pages')
    .act(res({
    	prefix: [
    		'http://res1.cdn.cn/static',
    		'http://res2.cdn.cn/static',
    		'http://res3.cdn.cn/static',
    		'http://res4.cdn.cn/static',
    		'http://res5.cdn.cn/static'
    	], // url的前缀,有多个cdn可配置多个
        templatePath: '~/src/template/', // 要替换的文件路径
        versionPath: '~/dist/version.json', // 带有静态资源hash值信息的文件
        regPre: '\/static\/' // 匹配文中url正则的前缀
    }), {global: true});

配置说明

参数 | 说明 | 缺省值 ------------ | ------------- | ------------ prefix | 必填,数组,替换后的url前缀,可配置多个域名,最大限度利用http请求资源的并发数 | 无 templatePath | 必填,支持bone的路径格式,要处理的文件所在的路径 | 无 versionPath | 必填,记载着要替换文件的hash值所在的version文件 | 无 regPre | 模板文件中静态资源的统一前缀 | /static/ ext | 数组,要替换的扩展名 | ['jpg', 'png', 'gif', 'bmp', 'js', 'swf', 'css']