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

@funish/githooks

v0.0.5

Published

Programmatically create git hooks, powered by Funish.

Downloads

261

Readme

@funish/githooks

npm version npm downloads npm license Contributor Covenant

Programmatically create git hooks, powered by Funish.

Inspired by husky and with an extremely similar implementation, but modified and supplemented with some possible details.

Getting started

# npm
$ npm install -D @funish/githooks

# yarn
$ yarn add -D @funish/githooks

# pnpm
$ pnpm add -D @funish/githooks

Usage

Recommend

For unified processes, we prefer to use configuration files to manage certain simple commands. This method is only suitable for fixed configuration management and githooks install should be re-run after making changes to the configuration file.

// githooks.config.ts
import { defineGithooksConfig } from "@funish/githooks";

export default defineGithooksConfig({
  hooks: {
    "pre-commit": "pnpm lint staged",
    "commit-msg": "pnpm lint commit-msg",
  },
});

Configuration

Type definition

export interface GithooksConfig {
  path?: string;
  hooks?: {
    [key in GithooksName]?: string;
  };
  gitConfig?: object;
  extends?: string | [string];
}

Husky Like

We can also use it in a similar way to Husky, except that the default folder will be .githooks.

# Install Git hooks during the post-installation phase of the lifecycle.
# Or you can use `pnpm githooks install -S prepare`.
$ pnpm githooks install -S

# Set up Git hooks.
$ pnpm githooks setup <hooks> [script]

# Uninstall Git hooks.
$ pnpm githooks uninstall

# Migrating from husky to @funish/githooks.
$ pnpm githooks migrate

CLI

$ githooks -h

USAGE githooks install|setup|uninstall|migrate

COMMANDS

    install    Install Git hooks.
      setup    Set up Git hooks.
  uninstall    Uninstall Git hooks.
    migrate    Migrating from husky to @funish/githooks.

Use githooks <command> --help for more information about a command.

Interfaces

See it on JSDoc.

Related Efforts

License