Node wrapper for git-clang-format
Python script as a standalone native binary to allow execution without a Python dependency.
This package already includes clang-format-node
, so there’s no need to install it separately.
npm install -g clang-format-git
yarn global add clang-format-git
pnpm add -g clang-format-git
bun add -g clang-format-git
npm install --save-dev clang-format-git
yarn add --dev clang-format-git
pnpm add -D clang-format-git
bun add -d clang-format-git
You can use the commands below to run git-clang-format
.
clang-format-git
is an alias forgit-clang-format
and works in exactly the same way.
npx git-clang-format
npx clang-format-git
These APIs depends on the Node.js fs
and path
module and the file system, so you cannot use it in browsers.
-
CommonJS
const { gitClangFormatPath, clangFormatGitPath, getGitClangFormatPath, getClangFormatGitPath, } = require('clang-format-git');
-
ES Modules
import { gitClangFormatPath, clangFormatGitPath, getGitClangFormatPath, getClangFormatGitPath, } from 'clang-format-git';
The ABSOLUTE path to the git-clang-format
executable binary based on the OS platform and architecture.
- Alias:
clangFormatGitPath
. SeeclangFormatGitPath
. - Version:
v1.2.0
Initial release.
Alias for gitClangFormatPath
.
- Alias:
gitClangFormatPath
. SeegitClangFormatPath
. - Version:
v1.2.0
Initial release.
Returns the ABSOLUTE path to the git-clang-format
executable binary based on the OS platform and architecture.
The possible combinations are darwin-arm64
, darwin-x64
, linux-arm
, linux-arm64
, linux-ppc64
, linux-s390x
, linux-x64
, win32-x64
.
Throws an error if the executable is not found.
- osPlatform (
string
): The current operating system platform. (e.g.,darwin
,linux
,win32
) - architecture (
string
): The current system architecture. (e.g.,arm
,arm64
,ppc64
,s390x
,x64
)
string
: The absolute path to thegit-clang-format
executable binary.
Error
: Throws an error if the executable binary is not found for the specified OS platform and architecture.
- Alias:
getClangFormatGitPath
. SeegetClangFormatGitPath
. - Version:
v1.2.0
Initial release.
Alias for getGitClangFormatPath
.
- Alias:
getGitClangFormatPath
. SeegetGitClangFormatPath
. - Version:
v1.2.0
Initial release.