qtty-js
ActiveJavaScript and WebAssembly bindings for qtty, with Node and browser packages for typed units and conversions.
0 stars
0 forks
JavaScript
AGPL-3.0
Updated today
Why it exists
qtty-js exposes the qtty unit system to JavaScript runtimes through aligned Node and Web packages. It keeps the canonical conversion model in the vendored Rust workspace while presenting ergonomic JS and TypeScript APIs.
Key Features
- Node package: @siderust/qtty
- Browser/WASM package: @siderust/qtty-web
- Typed Quantity and DerivedQuantity APIs
- Unit factories and TypeScript declarations
- Shared conversion semantics from vendored qtty
Getting Started
npm install @siderust/qtty
const { Quantity, Unit, convert } = require('@siderust/qtty');
const distance = new Quantity(1500, Unit.Meter);
console.log(distance.to(Unit.Kilometer).value);
console.log(convert(2, Unit.Hour, Unit.Minute)); Contributing
We welcome contributions! Here's how you can help:
- 1 Fork the repository and create your branch from main
- 2 Make your changes and add tests if applicable
- 3 Ensure all tests pass with cargo test
- 4 Submit a pull request with a clear description
License
This project is licensed under the AGPL-3.0 license. See the LICENSE file for details.
Quick Links
Tags
javascript wasm node browser units bindings