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

cc-init

v1.1.1

Published

set commitlint & conventional-changelog quickly

Downloads

12

Readme

cc-init

NPM version NPM Downloads

Set commitlint & conventional-changelog quickly

Why?

I need to write and install lots of works when I want to use commitlint with @moyuyc/husky and conventional-changelog, commitizen for conventional changelog.

{
  "scripts": {
    "version": "npm run changelog",
    "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md"
  },
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
    }
  },
  "commitlint": {
    "extends": ["@commitlint/config-conventional"]
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/foo"
    }
  }
  "devDependencies": {
    "@commitlint/cli": "^7.1.1",
    "@commitlint/config-conventional": "^7.1.1",
    "conventional-changelog-cli": "^2.0.5",
    "@moyuyc/husky": "^1.1.1"
  }
}

So the package can help you setting commitlint & conventional-changelog quickly.

Usage

CLI

npm install cc-init -g
# or use yarn
yarn global add cc-init
cc-init -h

Package

import ccInit from 'cc-init'
ccInit(cwd, {
  // ...options
})

API

cli

bin.js:32-41

export CHANGELOG_PRESET=@baidu/befe
export CHANGELOG_PRESET_PKGNAME=@baidu/conventional-changelog-befe
export COMMITIZEN_ADAPATOR=@baidu/cz-conventional-changelog-befe
export NPM_REGISTRY=http://registry.npm.baidu-int.com
export COMMITLINT_PRESET=@baidu/commitlint-config-befe
# Preset the default values
cc-init

ccInit

index.js:36-166

make commitlint, husky and conventional-changelog getting along harmoniously together.

Parameters

  • cwd {string} - the project's root path
  • opts {{}}
    • opts.commitizenAdaptor {string|null} (optional, default null)
    • opts.commitizenInGlobal {boolean} (optional, default true)
    • opts.changelogPresetPkgName {string} the custom changelog preset package's name should be installed like @scoped/conventional-changelog-foo (optional, default '')
    • opts.changelogPreset {string} conventional-changelog's preset like @scoped/foo (optional, default 'angular')
    • opts.registry {string} the npm's registry (optional, default '')
    • opts.commitlintPreset {string} the commitlint's preset config (optional, default '@commitlint/config-conventional')
    • opts.force {boolean} - overwrite the existed config and devDependencies in package.json
    • opts.stdio {string} the stdio of npm install process (optional, default 'inherit')

Returns boolean

License

MIT