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

git-consistent

v1.1.4

Published

Give consistency to your project's git logs.

Downloads

52

Readme

git-consistent Test and Lint "npm" MIT "git-consistent friendly"

Give consistency to your project's git logs.

"node v14" "node v16" "node v17" "node v18" "node v20"

Samples

Install

$ npm install -g git-consistent
# or
$ yarn global add git-consistent

Optional settings

# set alias
$ git config --global alias.con "consistent -i"

# setting editor (for text type input) if you use editor other than vim.
$ export EDITOR='code -w'
# or
$ export EDITOR='atom -w'
# or
$ export EDITOR='subl -w'
# or etc.

Usage

Init

$ git consistent --init
Use Type? (Y/n): Y
Use Emoji? (y/N): N
Does the subject start with lower case? (Y/n): Y
Does the subject put dot (.) at end? (y/N): Y

Generated '.gitcommit_template' and '.git_consistent'.
You can edit them freely.
Enjoy!

Output usage

$ git-consistent --help

  Usage: git-consistent [options]


  Options:

    --type <type>            commit type
    -m, --subject <subject>  The subject contains succinct description of the change
    --body [body]            The body contains details of the change (default: )
    ...
    -V, --version            output the version number
    -h, --help               output usage information

Inline mode

$ git consistent --type="feat" --subject="implement new feature" --body="This is amazing feature."

Interactive mode

$ git consistent -i
Select type: feat
Enter subject: implement new feature
Enter body multiline:
This is amazing feature.

You can use both mode interactive and inline at the same time. In that case, you input value that are not given as option only.

$ git consistent -i --subject="implement new feature"
Select type: feat
Enter body multiline:
This is amazing feature.

--subject have alias of -m. You can commit like you normally do!

$ git config --global alias.con "consistent -i"
$ git con -m "write README"
? Select type: docs
git commit -m "docs: write README"

Advance

Decorate

scope:
  type: text
  required: false
  description: 'The scope could be specifying place of the commit change.'
  prefix: '('
  suffix: ')'

format check

subject:
  type: string
  required: true
  description: 'The subject contains succinct description of the change'
  rules:
    firstLetter: lower
    dotAtEnd: false
    ascii: false
$ git consistent --subject="Write documents."
subject must be first letter is lowercase.
subject should not put dot (.) at the end.

$ git consistent --subject="ドキュメントを書いた"
subject must be first letter is lowercase.
subject should only alphabet.

variables

<githubIssueNum> <subject>

<githubIssueUrl>
<body>
githubIssueNum:
  type: string
  required: false
  description: 'github issue number'
  prefix: 'fix #'
subject:
  type: string
  required: true
  description: 'The subject contains succinct description of the change'
githubIssueUrl:
  type: variable
  origin: githubIssueNum
  description: 'github issue url'
  prefix: 'https://github.com/isuke/git-consistent/issues/'
body:
  type: text
  default: ''
  required: false
  description: 'The body contains details of the change'
$ git consistent -i --subject="test" --body="This is test."
Enter githubIssueNum: 12

$ git log -n 1
commit a9d6457f3674c8620fbe72c769cee09ba5459f02
Author: isuke <[email protected]>
Date:   Sat Feb 10 17:40:33 2018 +0900

    fix #12 test

    https://github.com/isuke/git-consistent/issues/12
    This is test.

branch

<subject>

<issueLink><body>
...
issueLink:
  type: branch
  required: false
  description: 'Github issue link'
  regExp: 'issue([0-9]+)'
  prefix: 'https://github.com/you/repository/issues/'
  suffix: "\n"
...
$ git branch
* issue123_hoge
  master

$ git consistent -i --subject="test" --body="This is test."

$ git log -n 1
commit a9d6457f3674c8620fbe72c769cee09ba5459f02
Author: isuke <[email protected]>
Date:   Sat Feb 10 17:40:33 2018 +0900

    test

    https://github.com/you/repository/issues/123
    This is test.

emoji

emoji:
  type: enum
  required: true
  description: 'commit type'
  values:
    -
      name: ':heavy_plus_sign:'
      description: 'when implementing function'
    -
      name: ':sunny:'
      description: 'when fixing a bug'
    -
      name: ':art:'
      description: 'when refactoring'

git-duet

Run git-duet mode when with -d option.

$ git consistent -d --type="feat" --subject="duet test" --body=""

$ git log -n 1
Author: isuke <[email protected]>
Date:   Sat Feb 10 15:13:40 2018 +0900

    feat: duet test

    Signed-off-by: foo <[email protected]>

Type list sample

sample type list

.git_consistent format

<term>:
  <option key>: <option value>
  <option key>: <option value>
  <option key>: <option value>
<term>:
  <option key>: <option value>
  <option key>: <option value>
  <option key>: <option value>
<term>:
  <option key>: <option value>
  <option key>: <option value>
  <option key>: <option value>

| key | description | value | | ---------------- | -------------------------------------------------- | ------------------------------------------------------------------------ | | term | .gitcommit_template's term | string | | option key | term's options | type, required, description, values, prefix, suffix, rules | | type | term's input type | enum, string, text, variable, branch | | required | required? | boolean | | description | term's description | string | | values | enum's values | Array | | prefix | a decoration to be attached before the input value | string | | suffix | a decoration to be attached after the input value | string | | regExp | (type: branch only) regular expression for extracting values from branch names | string | | regExpMatchNum | (type: branch only) number of values to retrieve from the match specified by regExp | string | | regExpFlag | (type: branch only) regExp's falg | i | | rules | input value format rules | Object | | rule key | rule's type | firstLetter, dotAtEnd, nonAscii, numberOnly | | firstLetter | upper case or lower case about input value's first letter | upper, lower | | dotAtEnd | need dot (.) input value's last | boolean | | nonAscii | Use not ascii symbols | boolean | | numberOnly | number only? | boolean | | maxLength | max length of string | integer | | minLength | min length of string | integer |

Command options

| Option | Description | | ------------------- | ------------------------- | | -d, --duet | run git-duet mode | | -D, --dry-run | run dry-run mode | | -i, --interactive | run interactive mode | | -S, --silent | don't show commit command | | -I, --init | generate config files | | -V, --version | output the version number |

Badges

git-consistent friendly

  • Markdown
[![git-consistent friendly](https://img.shields.io/badge/git--consistent-friendly-brightgreen.svg)](https://github.com/isuke/git-consistent)
  • reStructuredText
.. image:: https://img.shields.io/badge/git--consistent-friendly-brightgreen.svg   :alt: git-consistent friendly   :target: https://github.com/isuke/git-consistent
  • AsciiDoc
image:https://img.shields.io/badge/git--consistent-friendly-brightgreen.svg["git-consistent friendly",link="https://github.com/isuke/git-consistent"]