0.2.8 • Published 4 months ago
@wasm-fmt/clang-format v0.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);