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

@melody-core/melody-git-hook

v1.0.9

Published

提供git kook的功能!

Downloads

14

Readme

melody-git-hook

how to use?

English

in your project package.json, add:

"sctript": {
    //...others
    "prepare": "melody-git-hook"
}

then install @melody-core/melody-git-hook

yarn add @melody-core/melody-git-hook -D

now, you can see your project which dir named '.melody' and file 'pre-commit'; you are seccessful.

if you want to update the shell, just write the file which named 'pre-commit'.

中文

在你的项目的package.json里,添加:

"sctript": {
    //...others
    "prepare": "melody-git-hook"
}

然后安装这个依赖

yarn add @melody-core/melody-git-hook -D

现在你可以看到你的项目里有 .melody 文件夹和pre-commit文件 你成功啦 现在尝试执行'git commit'的话,你将发现会先执行 pre-commit文件的shell脚本。 如果你想改变它的内容,直接重写这个文件内容就可以了,比如:

npm run test

问题和解决方案

  1. 如果您在安装它之前没有在script中配置prepare脚本命令,那么您的项目里将不会生成.melody-git-hook文件夹。 只需要在script上添加上这个脚本,并且执行 npm install 或者 yarn 即可。

  2. 如果存在了.melody 以及 pre-commit,但您commit的时候,pre-commit里的shell没有执行,那么请手动执行下面的脚本

git config core.hooksPath .melody-git-hook
  1. 给这个文件添加可执行权限:
chmod +x .melody-git-hook/pre-commit  

这样就可以了!

我想添加更多的git-hook

比如pre-push: 请在.melody-git-hook中添加文件pre-push,内容写要执行的shell脚本。 然后手动执行下面的命令:

git config core.hooksPath .melody-git-hook
chmod +x .melody-git-hook/pre-push

ok啦!

声明

这是一个简单的尝试,未来作者@六弦会不断完善它,期望能取代husky的地位~