UNPKG

clang-format-node

Version:

Node wrapper for clang-format native binary inspired by angular/clang-format.🐉

31 lines (30 loc) 2.03 kB
/** * Returns the ABSOLUTE path to the `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. * @param {string} osPlatform The current operating system platform. (e.g., `darwin`, `linux`, `win32`) * @param {string} architecture The current system architecture. (e.g., `arm`, `arm64`, `ppc64`, `s390x`, `x64`) * @returns {string} The ABSOLUTE path to the `clang-format` executable binary. * @throws `Error` Throws an error if the executable binary is not found for the specified OS platform and architecture. * @alias `getClangFormatNodePath`. See {@link getClangFormatNodePath}. * @version `v1.2.0` Initial release. * @see https://clang-format-node.lumir.page/docs/apis/clang-format-node */ export function getClangFormatPath(osPlatform: string, architecture: string): string; /** * Returns the ABSOLUTE path to the `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. * @param {string} osPlatform The current operating system platform. (e.g., `darwin`, `linux`, `win32`) * @param {string} architecture The current system architecture. (e.g., `arm`, `arm64`, `ppc64`, `s390x`, `x64`) * @returns {string} The ABSOLUTE path to the `clang-format` executable binary. * @throws `Error` Throws an error if the executable binary is not found for the specified OS platform and architecture. * @alias `getClangFormatNodePath`. See {@link getClangFormatNodePath}. * @version `v1.2.0` Initial release. * @see https://clang-format-node.lumir.page/docs/apis/clang-format-node */ export function getClangFormatNodePath(osPlatform: string, architecture: string): string;