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 🙏

© 2026 – Pkg Stats / Ryan Hefner

changelog-sn

v2.2.0

Published

changelog

Readme

功能

该工具针对一些需要手动输入更新日志的项目,实现自动化输出更新日志,并且对更新日志进行内容格式化,便于后期维护,目前主要有以下几个功能模块。

  1. cz -- 定制化 git 提交
  2. log -- 自动生成 CHANGELOG.md 日志文件
  3. lint -- 校验 commit 信息

依赖安装

npm install changelog-sn --save-dev

配置commitlint和commitizen

代码仓库根目录创建文件.commitlintrc.js.czconfigrc.js

配置.commitlintrc.js内容

module.exports = Object.assign({}, require('changelog-sn/lib/lint'), {
  rules: {
    'subject-empty': [2, 'never'],
    'type-empty': [2, 'never'],
    'scope-empty': [2, 'never'],
    'type-enum': [
      2,
      'always',
      [
        '新功能',
        '修复',
        '优化',
        '重构',
        '文档',
        'chore',
        'revert',
        'WIP',
        'docs',
        'build',
        'release'
      ]
    ]
  }
})

配置.czconfigrc.js

module.exports = {
  types: [
    { value: '新功能', name: '新功能 : 新增加一个功能' },
    { value: '修复', name: '修复   : 一个 bug 修复' },
    { value: '优化', name: '优化   : 提升性能的代码更改' },
    { value: '重构', name: '重构   : 不涉及修复bug和新功能开发的代码更改' },
    { value: '文档', name: '文档   : 只有文档发生改变' },
    { value: 'chore', name: '构建   : 修改持续集成的配置文件和脚本' },
    { value: 'revert', name: '撤销   : 撤销一个历史提交' },
    { value: 'WIP', name: '待完成 : 研发中的提交备份' }
  ],
  messages: {
    type: '选择你提交的信息类型:',
    scope: '选择本次提交的改变所影响的范围?',
    customScope: '本次提交的改变所影响的范围?',
    subject: '写一个简短的变化描述,尽量清晰描述改动内容,杜绝简单的单词:\n',
    body: '提供更详细的变更描述 (按 enter 跳过). 使用 "|" 换行:\n',
    breaking: '列出所有的不兼容变更 (按 enter 跳过):\n',
    footer: '列出此次改动解决的所有 jira (如:"#123, #234")(按 enter 跳过):\n',
    confirmCommit: '确认提交以上内容信息?'
  },
  allowBreakingChanges: ['refactor', 'chore'],
  breakingPrefix: 'WARNING:',
  skipQuestions: ['body'],
  // limit subject length
  subjectLimit: 100,
  breaklineChar: '|',
  footerPrefix: 'JIRA CLOSED:'
}

配置package.json

{
  "scripts": {
    "log": "changelog-sn -i CHANGELOG.md -s -r 2",
    "cz": "git add . && cz",
    "v": "standard-version --prerelease"
  },
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-customizable"
    },
    "cz-customizable": {
      "config": "./.czconfigrc.js"
    }
  },
  "standard-version": {
    "message": "chore(release): %s",
    "skip": {
      "changelog": true
    }
  },
  "devDependencies": {
    "changelog-sn": "2.2.0",
    "standard-version": "9.3.2"
  }
}

scripts命令之log

该命令用来生成CHANGELOG.MD日志

scripts命令之cz

该命令会先执行add改动文件并执行cz来代替git commit以获得commit信息帮助,也可分开执行git add .npx cz,如果全局安装commitizen可直接使用cz

scripts命令之v

使用standard-version插件按照配置规则升级版本,标记tag