JSPM

@simbo/git-constants

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q30883F
  • License MIT

A small collection of Git-related constants for working with Git references, branches, tags, and commit identifiers in a consistent way.

Package Exports

  • @simbo/git-constants

Readme

Git Constants

📦 @simbo/git-constants

A small collection of Git-related constants that can be reused across Node.js and TypeScript projects.

Useful for working with Git references, branches, tags, and commit identifiers in a consistent way.

Features

  • Predefined constants for common Git concepts

  • Covers .git folder name, reference prefixes (refs/, refs/heads/, refs/remotes/, refs/tags/, refs/pulls/), and /merge suffix

  • Default branch name (main)

  • Short SHA length (7) for commit references

  • Fully typed with TypeScript

  • Zero dependencies

Installation

Install @simbo/git-constants from the npm registry:

npm i [-D] @simbo/git-constants

Usage

For a complete API reference, see the documentation.

import {
  GIT_DEFAULT_BRANCH,
  GIT_FOLDER,
  GIT_REFS_PREFIX,
  GIT_REFS_HEADS_PREFIX,
  GIT_SHA_SHORT_LENGTH,
} from '@simbo/git-constants';

console.log(GIT_DEFAULT_BRANCH); // "main"
console.log(GIT_FOLDER); // ".git"
console.log(GIT_REFS_PREFIX); // "refs/"
console.log(GIT_REFS_HEADS_PREFIX); // "refs/heads/"
console.log(GIT_SHA_SHORT_LENGTH); // 7

License

MIT © Simon Lepel