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

@jiahe/git-setup

v1.0.3

Published

A utility that helps to setup common Git config and alias settings

Downloads

6

Readme

git-setup

本工具会全自动设定 Git 版控环境,并且跨平台支援 Windows, Linux, macOS 等作业系统的命令列环境,尤其针对中文环境经常会出现乱码的问题都会完整的解决。

先决条件

  • Node.js 10.13.0 以上版本
  • Git 任意版本 (建议升级到最新版)

使用方式

npx @jiahe/git-setup
  • 设定过程会询问你的 user.nameuser.email 资讯
  • Email 会进行格式验证,格式错误会拒绝设定下去
  • 所有 Git 设定都会以 --global 为主 (~/.gitconfig)
  • Windows 平台会自动设定 LC_ALLLANG 使用者环境变数
  • Linux, macOS 平台会提醒进行设定

设定内容

git config --global user.name  ${name}
git config --global user.email  ${email}

# 设定打错命令时 3 秒内会自动做出判断
git config --global help.autocorrect 30

# 现在大多编辑器都已经能正确处理 CRLF 字元,不再需要自动转换了!
git config --global core.autocrlf false

# 为了能正确显示 UTF-8 中文字
git config --global core.quotepath false

# 在命令列环境下自动标示颜色
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

# 常用的 Git Alias 命令
git config --global alias.ci   commit
git config --global alias.cm   "commit --amend -C HEAD"
git config --global alias.co   checkout
git config --global alias.st   status
git config --global alias.sts  "status -s"
git config --global alias.br   branch
git config --global alias.re   remote
git config --global alias.di   diff
git config --global alias.type "cat-file -t"
git config --global alias.dump "cat-file -p"
git config --global alias.lo   "log --oneline"
git config --global alias.ls   "log --show-signature"
git config --global alias.ll   "log --pretty=format:'%h %ad | %s%d [%Cgreen%an%Creset]' --graph --date=format:'%Y-%m-%d %H:%M:%S"
git config --global alias.lg   "log --graph --pretty=format:'%Cred%h%Creset %ad |%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset [%Cgreen%an%Creset]' --abbrev-commit --date=format:'%Y-%m-%d %H:%M:%S"
git config --gloabl alias.sbtime !"for k in `git branch|perl -pe s/^..//`;do echo `git show --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset\" $k|head -n 1`\\\t$k;done|sort"
git config --gloabl alias.sbrtime !"for k in `git branch -r|perl -pe s/^..//`;do echo `git show --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset\" $k|head -n 1`\\\t$k;done|sort"
git config --global alias.alias "config --get-regexp ^alias\."

# 必须是 Windows 平台才会执行以下设定
git config --global alias.ignore '!gi() { curl -sL https://www.gitignore.io/api/$@ ;}; gi'
git config --global alias.iac '!giac() { git init && git add . && git commit -m 'Initial commit' ;}; giac'

# 必须是 Linux/macOS 平台才会执行以下设定
git config --global alias.ignore '!'"gi() { curl -sL https://www.gitignore.io/api/\$@ ;}; gi"
git config --global alias.iac '!'"giac() { git init && git add . && git commit -m 'Initial commit' ;}; giac"


# 必须是 Windows 平台且有安装 TortoiseGit 才会设定 tlog 这个 alias
git config --global alias.tlog "!start 'C:\\PROGRA~1\\TortoiseGit\\bin\\TortoiseGitProc.exe' /command:log /path:."

# 必须是 Windows 平台才会将预设编辑器设定为 notepad
git config --global core.editor notepad

提供建议

如果您对本工具有任何想法,欢迎到这里留言讨论!