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

web-norm

v1.1.8

Published

前端项目规范一键安装

Downloads

28

Readme

其他性感的开源项目 🔥🔥

初衷

每当接手一个新项目(如果项目中没有配置 eslint husky commitlint)等这些规范的话,就需要自己手动配置一遍,配置多了后我只能来句窝草!😬

目标

一个命令自动化配置项目规范

你将得到

  • 保存代码自动格式化 💯
  • 提交前 commit 校验 💯
  • eslint + pretter 校验 💯
  • husky 自动装载 💯
  • 说吧,你还想要啥...

安装

1 局部安装(推荐使用)

npm install web-norm -D | yarn add web-norm -D | pnpm install web-norm -D

在 package.json 中

 "scripts": {
    "web-norm": "web-norm",
  },
  1. 全局安装
npm install web-norm -g | yarn add web-norm -g | pnpm install web-norm -g

使用

运行命令

请确保您的项目使用了git,否则会导致`husky`不生效
npm run web-norm

支持配置

web-norm 默认在提交记录上为带表情符号 📦👷📝🌟🐛🚀🌠🔂💎🚨 。如果不喜欢这些表情符号的话可以在用 web-norm 初始化项目的时候加上 --noEmoji 去掉

 "scripts": {
    "web-norm": "web-norm --noEmoji",
  },

验证

代码提交前校验

npm run commit

在老项目中使用

在老项目使用会牵扯到一个问题就是以前的代码规范和通过web-norm生成的代码规范不一致怎么办?

1、如果项目比较小,只有几个文件,你可以把所以的文件都保存一遍即可(保存的时候 vscode 会自动格式化代码,确保使用 vscode 编辑器并安装 eslint 和 pretter 插件)

2、如果项目比较大,建议使用 vscode 插件Format Files进行自动化保存

可能遇到问题,详细内容参考这篇文章可能遇到问题

  • husky 无法触发
  1. 项目首先需要被 git 管理

  2. mac 电脑执行 npm run postinstallmac 来设置 husky 的读写权限

说明

  1. 在使用过程中遇到任何问题,请提交 issues 😚