It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
29%
Published
a year ago (0.2.8)
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
Add Package
deno add jsr:@mst-mkt/clang-fmt
Import symbol
import * as clang_fmt from "@mst-mkt/clang-fmt";
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
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
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";