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

leave-me-alone

v0.1.1

Published

leave me alone

Readme

中心化不同渠道代码的抽离工具

动机

  • 项目已经分离,需要消除冗余代码
  • 方便阅读代码和梳理业务逻辑
  • 避免僵尸复活祸害人间

DEMO

demo

安装

$ sudo npm install git+http://git.mucfc.com/chenhanjie/leave-me-alone.git -g --registry=https://registry.npm.taobao.org

因为是cli命令,所以需要全局安装

简易命令

$ leave-me-alone wechat
$ leave-me-alone app

详细用法

  • 帮助 leave-me-alone -h
  Usage: leave-me-alone [options] [command]
  Commands:
    wechat|w [options] [filepath]  只保留wechat代码
    app|a [options] [filepath]     只保留app代码
    *
  Options:
    -h, --help     output usage information
    -V, --version  output the version number
  • 只保留当前目录各文件wechat渠道的代码
$ cd your-fold
$ leave-me-alone wechat
  • 只保留当前目录各文件的App渠道的代码
$ cd your-fold
$ leave-me-alone app
  • 只处理指定的子目录或文件中的代码

指定的目录为当前执行目录的子目录,文件为当前目录中的文件

$ cd your-fold
// 指定目录
$ leave-me-alone wechat your/subfold/
// 指定文件
$ leave-me-alone wechat your/subfold/filename.suffix
  • 只处理特定的文件类型

目前支持的文件类型为htmltpljs

$ cd your-fold
// 只处理html文件
$ leave-me-alone wechat -s html
// 多种文件类型使用半角逗号(,)间隔
$ leave-me-alone wechat -s html,tpl,js

建议

最好在工程的src/pages或其子目录下运行。直接在工程目录运行会处理src/components中的文件。

  • 项目的src/componets中,也有需要抽离的代码,但是作为基础模块,抽离是否合适,或src/componets本应该跟渠道无关。

对目录转换后,使用diff工具检查一下,diff的高亮,可以很快看出抽离是否正确。

效果

运行$ leave-me-alone wechat

  • html result html_result

  • tpl result tpl_result

  • js result js_result

测试

$ git clone http://git.mucfc.com/chenhanjie/leave-me-alone.git
$ cd levae-me-alone
$ npm run test

TODO

  • ~~windows上的兼容性~~ ✔
  • 在中心化构建中移除process过程

END