Skip to main content
Home

latest

[fork] from @fmt/clang-format

It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
29%
Published
a year ago (0.2.8)

Test npm

Install

npm install @wasm-fmt/clang-format

Usage

import init, { format } from '@wasm-fmt/clang-format';

await init();

const source = `
#include <iostream>
using namespace std;
auto main() -> int{
std::cout << "Hello World!" << std::endl;
return 0;}
`;

const formatted = format(
    source,
    "main.cc",
    JSON.stringify({
        BasedOnStyle: "Chromium",
        IndentWidth: 4,
        ColumnLimit: 80,
    })
);

console.log(formatted);

Build from source

  1. Install LLVM and Clang (version 18 or later).
  2. Install CMake (version 3.27 or later).
  3. Install Ninja (version 1.11 or later).
  4. Clone this repository.
  5. Run scrips/build.sh.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@mst-mkt/clang-fmt

Import symbol

import * as clang_fmt from "@mst-mkt/clang-fmt";
or

Import directly with a jsr specifier

import * as clang_fmt from "jsr:@mst-mkt/clang-fmt";

Add Package

pnpm i jsr:@mst-mkt/clang-fmt
or (using pnpm 10.8 or older)
pnpm dlx jsr add @mst-mkt/clang-fmt

Import symbol

import * as clang_fmt from "@mst-mkt/clang-fmt";

Add Package

yarn add jsr:@mst-mkt/clang-fmt
or (using Yarn 4.8 or older)
yarn dlx jsr add @mst-mkt/clang-fmt

Import symbol

import * as clang_fmt from "@mst-mkt/clang-fmt";

Add Package

vlt install jsr:@mst-mkt/clang-fmt

Import symbol

import * as clang_fmt from "@mst-mkt/clang-fmt";

Add Package

npx jsr add @mst-mkt/clang-fmt

Import symbol

import * as clang_fmt from "@mst-mkt/clang-fmt";

Add Package

bunx jsr add @mst-mkt/clang-fmt

Import symbol

import * as clang_fmt from "@mst-mkt/clang-fmt";