1.1.0 • Published 5 months ago

add-wasm2js v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

add-wasm2js

npm version License: MIT

CLI tool to add wasm2js template to your wasm-pack project.

Prerequisites

Usage

  1. First, create a new wasm-pack project:

    wasm-pack new my-wasm-project
    cd my-wasm-project
  2. Then, add wasm2js support:

    npx add-wasm2js

This will create a wasm2js directory in your project with:

  • Frontend development environment
  • Build scripts for wasm2js
  • Development server setup

Testing Your WASM Module

After setup, you can test your WASM module:

cd wasm2js
npm run dev

The template includes a default "greet" function test. To test your own functions, modify frontend/src/main.ts.

Project Structure

After running add-wasm2js, your project will look like this:

my-wasm-project/          # Your wasm-pack project root
├── src/                  # Rust source code
├── Cargo.toml
└── wasm2js/             # wasm2js specific files
    ├── frontend/        # Frontend code
    │   └── src/
    │       └── main.ts  # Test your functions here
    └── ...

Development

To contribute to this project:

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Run tests:
    npm test

Author

Yasuo Higa

License

This project is licensed under the MIT License - see the LICENSE file for details.

1.1.0

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago