Pinned, cross-platform clang tooling — clang-format, clang-tidy,
clang-apply-replacements, clang-query — distributed as npm packages and as
standalone binaries, so a whole team and CI run exactly the same tools with no
per-machine install drift, no Python, and no custom Homebrew tap. The tool set is
declared in scripts/tools.mjs.
The version is the LLVM version. @polycam/clang-tools@22.1.8 gives you
clang-format and clang-tidy from LLVM 22.1.8, everywhere.
yarn add -D @polycam/clang-tools@22.1.8
npx clang-format --version # clang-format version 22.1.8
npx clang-tidy --version # LLVM version 22.1.8LLVM publishes no standalone per-tool binaries — only a ~1.5 GB full-toolchain
tarball. Existing repackagers each fall short for a C++ shop that needs both
tools pinned to one version: clang-format-node is format-only, the PyPI wheels
drag in a Python toolchain, and the community static-binary projects lag several
LLVM releases behind (so no --experimental-custom-checks for query-based
custom clang-tidy checks). This repo repackages LLVM's own official release
binaries into per-platform npm packages and raw GitHub-release artifacts, on
a version we control.
The release workflow downloads the official LLVM-<version>-<platform>.tar.xz,
extracts the tools in scripts/tools.mjs plus clang's
builtin-header resource dir (lib/clang/<major>/include) for the ones that parse
C++, and packages them. No compilation — these are LLVM's own binaries, which run
standalone on their target OS. The resource dir ships beside the binaries, so
clang-tidy/clang-query need no -resource-dir wrangling.
- npm — a meta package (
@polycam/clang-tools) withos/cpu-scopedoptionalDependencies, so installs pull only the host's binaries. Seenpm/clang-tools/README.mdfor the API. - GitHub releases — every release attaches the standalone binaries with
.sha512checksums, forcurl-based consumers.
macOS arm64, Linux x86-64, Windows x86-64.
See RELEASING.md. In short: run the Release workflow and give it an LLVM version.
MIT. The clang-format/clang-tidy binaries are redistributed from the LLVM Project under the Apache-2.0-with-LLVM-exception license.