Documentation for Simbo's Packages
    Preparing search index...

    Module @simbo/git-constants - v1.0.1

    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.

    • 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

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

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

    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

    MIT © Simon Lepel

    Variables

    GIT_DEFAULT_BRANCH
    GIT_FOLDER
    GIT_REFS_HEADS_PREFIX
    GIT_REFS_PREFIX
    GIT_REFS_PULLS_PREFIX
    GIT_REFS_PULLS_SUFFIX
    GIT_REFS_REMOTES_PREFIX
    GIT_REFS_TAGS_PREFIX
    GIT_SHA_SHORT_LENGTH