@wokwi/astyle-web
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

astyle-wasm

Artistic Style (AStyle) compiled for Web Assembly

Build Status

Installation

To install the package, run the following command:

npm install --save astyle

For yarn users:

yarn add astyle

Usage example

const { format } = require('astyle');

format('void foo(){\nbar();}').then(result => {
  console.log(result);
});

// Output:
// void foo() {
//     bar();
// }

You can also pass AStyle options as a second argument for format(). For instance, you can change the indentation to tabs by specifying 'indent=tab'. The full list of options can be found in the AStyle docs.

Note: The package is currently supported only on Node.js. A web version may be available in the future.

Building the project and running the tests

You will need docker installed. To build:

npm run build:image
npm run build:copy

Then run the tests by executing:

npm test

Package Sidebar

Install

npm i @wokwi/astyle-web

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

702 kB

Total Files

8

Last publish

Collaborators

  • ariellae
  • urish