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

eslint-githook

v1.1.2

Published

git 钩子

Downloads

7

Readme

githooks

特性

安装此包,将会在项目目录的.git文件夹内植入钩子 目前的钩子种类: pre-commit,commit-msg

  1. 关于pre-commit git提交时的钩子,该钩子将会在git提交时自动触发 触发钩子会自动调用eslint,检测提交文件当中的.js和.vue文件 如果eslint未通过,则不允许提交

检测分为:normal和strict模式 normal模式:将忽略warning,只有error禁止提交 strict模式:warning和error都将禁止提交

钩子默认使用strict模式 如需改成normal模式,需要在package.json内配置

"config":{
    "lint":{
      "mode":"norsmal"
    }
 }

注意: eslint和git需要自行安装

  1. 关于commit-msg 该钩子会在pre-commit检测结束之后触发 将会检测commit message是否符合格式 (): 具体解释参照:commit-msg 检测失败会log出详细文档

可在项目package.json添加上如下配置项来覆盖默认配置

// 这里展示的是默认配置
 "config": {
    "validate-commit-msg": {
      "types": ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "revert"], // default
      "warnOnFail": false, // default
      "maxSubjectLength": 100, // default
      "subjectPattern": ".+", // default
      "subjectPatternErrorMsg": 'subject does not match subject pattern!', // default
      "helpMessage": "" //default
    }
  }

配置参照 validate-commit-msg

fix bug

grep正则问题,导致抓取了ejs文件

'.js$|.vue$' -> /.js|vue$/

未解决的问题

mac与sourceTree混合使用,并且nodejs是采用pkg方式安装在 /usr/local/bin/node 目录下 有已知bug 需要 ln -s /usr/local/bin/node /use/bin/node 才能使用