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

@redbuck/shrink

v1.1.2

Published

remove redundant file create by webpack watch mode

Downloads

1

Readme

一个用于提交前清除文件的工具

该工具为三部定制. 三部前端页面使用webpack打包.生成文件时,会将content-hash加入文件名. 因此生成的文件会越来越多. 同时watch模式时,也会产生大量文件

该工具利用[email protected]提供的git钩子功能. 提交时,扫描cshtml文件,获取对应的js/css文件标记以及本次构建的hash. 然后再检查提交的文件中对应的js/css文件,删除其中hash不符的文件.

使用

  1. 挂vpn
  2. 切换npm源为http://nexus.ops.svc.cluster.test/repository/npm-all/
  3. 项目根目录下执行yarn add shrink -d
  4. 执行node ./node_modules/shrink

参数

传参方式可以通过命令行或者配置shrinkrc.js

  1. 命令 node ./node_modules/shrink --staged false --log false
  2. shrinkrc.js 一个commonjs模块.

两者冲突时,shrinkrc.js优先级高

参数描述

|属性|类型|默认值|描述| |--:|--:|--:|--:| |since|string|undefined|git revision| |staged|boolean|true|是否只检查暂存区| |restage|boolean|true|删除冗余文件后是否重新暂存| |remove|boolean|false|是否删除冗余文件| |log|boolean|true|是否打印冗余文件| |branch|string|undefined|需要检查的分支| |matcher|function|()=>true|用于筛选目标文件| |supports|string[]|['.js', '.css', '.cshtml']|筛选目标文件的扩展名|