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

cnpmfilefix

v1.0.10

Published

修复cnpm文件缺失

Downloads

22

Readme

cnpmfilefix

使用说明

修复cnpm文件缺失

使用原理:通过分析 cnpm 同步 log, 获取无法安装的npm安装包,然后通过taobao npm源下载缺失的安装包

解决疼点:cnpm 私有源同步时丢失安装包,这个工具下载丢失的安装包到对应位置

一键初始化 (切换到项目根目录, 然后执行以下命令)

sudo npm install -g cnpmfilefix && cnpmfilefix --auto

安装全局指令

sudo npm install -g cnpmfilefix

设置处理指令与配置文件、并处理最近30天的日志文件: cnpmfilefix --auto

cd projectRoot && cnpmfilefix --auto

# cnpmfilefix --auto = cnpmfilefix --setup && cnpmfilefix --full

其他操作

设置提交指令并拷贝配置文件: cnpmfilefix --setup

cd projectRoot && cnpmfilefix --setup

# 这个指令自动添加1个npm模块 cnpmfilefix
# 并在 package.json 的 scripts 添加 cnpmfilefix 指令
# 拷贝 cnpmfilefix 模块里的 cnpmfilefix.config.js 到项目根目录

处理所有文件指令: cnpmfilefix --full

cd projectRoot && cnpmfilefix --full

# 处理所有符合条件的文件

处理指定文件指令: cnpmfilefix --target

cd projectRoot && cnpmfilefix --target /feuid/download/feuid-1.0.21.tgz

# 处理单个指定的文件

检查存在异常的文件: cnpmfilefix --check

cd projectRoot && cnpmfilefix --check

# 检查存在异常的文件,该指令只做检查用,不进行实际文件操作

显示帮助指令: cnpmfilefix --help

cnpmfilefix --help

# 显示所有可用命令

参数配置文件 cnpmfilefix.config.js

如果运行命令的项目根目录有 cnpmfilefix.config.js,工具会自动读取配置参数

cnpmfilefix.config.js 说明

{
    logsPath: "./dataDir/logs/"                               //设置日志文件目录
    , dataDir: "./dataDir/nfs/"                               //设置安装包根目录
    , lastDay: -30                                            //需要处理最近N天的日志
    , resolveRegistry: "https://registry.npm.taobao.org/"     //用于下载缺失文件的npm源
}