WAstyle is a WebAssembly port of the AStyle code formatter, enabling C, C++, and Java formatting in Node.js and browsers. The current stable version is 0.0.5, released with an MIT license. Unlike native AStyle bindings, WAstyle uses WASM for cross-platform portability, but requires manual initialization with the WASM binary due to Webpack limitations. It supports synchronous formatting after initialization and offers an optimized smaller WASM binary. Performance is suitable for typical file sizes, but the initialization step and Webpack configuration can be tricky for new users.
npm install wastyleNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows the required two-step process: initialize with WASM binary path, then call format with code and AStyle options.
Always await init(...) before calling format. Use try/catch or .catch on the promise.
Add { test: /\.wasm$/, loader: 'file-loader', type: 'javascript/auto' } to webpack module.rules.Use fs.readFile for Node.js; use fetch or file-loader URL for browsers.
This is by design; follow the manual init pattern described in the README.
Always destructure the array: const [success, result] = format(...);
Ensure you await init() before calling format(). Store a promise and check it.
Read the .wasm file with fs.readFile and pass the Buffer.
Disable the default loader as shown in the README: add rule with type: 'javascript/auto' and file-loader.
No dependency data recorded yet.