kopach/lockfix

GitHub: kopach/lockfix

lockfix 是一个基于 Git 的 CLI 工具,用于智能回退 npm 锁文件中 integrity 属性的非必要更改,从而消除因环境差异导致的无意义 diff。

Stars: 25 | Forks: 3

[![#StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine#readme)

  _               _    _____ _      

 | |    ___   ___| | _|  ___(_)_  __

 | |   / _ \ / __| |/ / |_  | \ \/ /

 | |__| (_) | (__|   <|  _| | |>  < 

 |_____\___/ \___|_|\_\_|   |_/_/\_\

[lockfix](https://github.com/kopach/lockfix)
[![Snyk 漏洞徽章](https://snyk.io/test/github/kopach/lockfix/badge.svg)](https://snyk.io/test/github/kopach/lockfix) [![可维护性](https://api.codeclimate.com/v1/badges/f7e2f85327eeb6b52439/maintainability)](https://codeclimate.com/github/kopach/lockfix/maintainability) [![语言评级:JavaScript](https://img.shields.io/lgtm/grade/javascript/g/kopach/lockfix.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kopach/lockfix/context:javascript) [![NPM 徽章](https://nodei.co/npm/lockfix.png?compact=true)](https://www.npmjs.com/package/lockfix)
[lockfix](https://github.com/kopach/lockfix) – 是一个基于 [git](https://git-scm.com/) 的 CLI 工具,用于还原 npm lock 文件中 `sha1` 完整性的更改

Before ![screenshot before](https://raw.githubusercontent.com/kopach/lockfix/master/assets/before.png) After ![screenshot after](https://static.pigsec.cn/wp-content/uploads/repos/cas/07/07f941594d81a828e70f1dedd40c0ff603d359a42fbd6d5e366bb140a87250d6.png)

## 🧬 目录 - [❓ 为什么?](#-why-) - [✨ 特性](#-features-) - [💾 安装](#-install-) - [🔨 用法](#-usage-) - [📄 许可证](#-license-) ## ❓ 为什么? [🔝](#-table-of-contents) [NPM](https://npmjs.org/) 有一个已知的问题,即其 lock 文件的 `integrity` 属性会不断变化。完整性的改变可能有多种原因。其中包括: - 在与生成 lock 文件的操作系统不同的机器上执行了 `npm install` - 某些 package 版本更新 - 使用了另一个版本的 `npm` 该工具的目的是防止此类更改,并使 `integrity` 属性安全可靠。 ## ✨ 特性 [🔝](#-table-of-contents) - 将更改从 `sha512` 还原为 `sha1`。保留从 `sha1` 到 `sha512` 的未受影响的更改。`sha512` 算法更安全。 - 同时适用于 `package-lock.json` 和 `npm-shrinkwrap.json` - 可以还原由**本工具**执行的任何更改 ## 💾 安装 [🔝](#-table-of-contents) 使用 [NPM](https://npmjs.org/) 为每个项目进行安装 ``` npm install --save-dev lockfix ``` 或者全局安装 ``` npm install -g lockfix ``` ## 🔨 用法 [🔝](#-table-of-contents) ### 添加到 `package.json` ``` "scripts": { "postshrinkwrap": "lockfix", }, ``` ### 从终端手动运行 ``` lockfix ``` 或者(未安装时) ``` npx lockfix ``` #### 选项 ``` Usage: lockfix [options] Options: -V, --version output the version number -c, --commit make backup commit with revert instruction before applying changes -f, --force bypass Git root directory check -q, --quiet suppress output -h, --help display help for command ``` ## 📄 许可证 [🔝](#-table-of-contents) 本软件基于 [MIT](https://github.com/kopach/lockfix/blob/master/LICENSE) 获得许可
标签:Git, GNU通用公共许可证, MITM代理, Node.js, npm, 依赖管理, 数据可视化, 文档结构分析, 暗色界面, 网络安全研究, 自动化攻击