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

@conventional-changelog/git-client

v1.0.1

Published

Simple git client for conventional changelog packages.

Downloads

584,135

Readme

@conventional-changelog/git-client

ESM-only package NPM version Node version Dependencies status Install size Build status Coverage status

Simple git client for conventional changelog packages.

Install

# pnpm
pnpm add @conventional-changelog/git-client conventional-commits-filter conventional-commits-parser
# yarn
yarn add @conventional-changelog/git-client conventional-commits-filter conventional-commits-parser
# npm
npm i @conventional-changelog/git-client conventional-commits-filter conventional-commits-parser

Note: conventional-commits-filter and conventional-commits-parser are required only if you need ConventionalGitClient#getCommits method.

Usage

import {
  GitClient,
  ConventionalGitClient
} from '@conventional-changelog/git-client'

// Basic git client
const client = new GitClient(process.cwd())

await client.add('package.json')
await client.commit({ message: 'chore: release v1.0.0' })
await client.tag({ name: 'v1.0.0' })
await client.push('master')

// Conventional git client, which extends basic git client
const conventionalClient = new ConventionalGitClient(process.cwd())

console.log(await conventionalClient.getVersionFromTags()) // v1.0.0

API

new GitClient(cwd: string)

Create a wrapper around git CLI instance.

getRawCommits(params?: GitLogParams, restRawArgs?: string[]): AsyncIterable<string>

Get raw commits stream.

getTags(restRawArgs?: string[]): AsyncIterable<string>

Get tags stream.

checkIgnore(file: string, restRawArgs?: string[]): Promise<boolean>

Check file is ignored via .gitignore.

add(files: string | string[], restRawArgs?: string[]): Promise<void>

Add files to git index.

commit(params: GitCommitParams, restRawArgs?: string[]): Promise<void>

Commit changes.

tag(params: GitTagParams, restRawArgs?: string[]): Promise<void>

Create a tag for the current commit.

getCurrentBranch(restRawArgs?: string[]): Promise<string>

Get current branch name.

push(branch: string, restRawArgs?: string[]): Promise<void>

Push changes to remote.

new ConventionalGitClient(cwd: string)

Wrapper around Git CLI with conventional commits support.

getCommits(params?: ConventionalGitLogParams, parserOptions?: ParserStreamOptions, restRawArgs?: string[]): AsyncIterable<Commit>

Get parsed commits stream.

getSemverTags(params?: GitTagsLogParams, restRawArgs?: string[]): AsyncIterable<string>

Get semver tags stream.

getVersionFromTags(prefix?: string, restRawArgs?: string[]): Promise<string | null>

Get current sematic version from git tags.

License

MIT © Dan Onoshko