@@ -31,22 +31,60 @@ console.log(greetMany(["Alan Turing", "Ada Lovelace"]));
3131 | <a href =" https://github.com/jcbhmr/hello-world-rust-wasm-component-lib " >WASM project</a >
3232</p >
3333
34+ 🏷️ Using v1.0.0 of [ jcbhmr/hello-world-rust-wasm-component-lib] \
35+ 🦀 WASM is written in Rust \
36+ 🟦 Includes TypeScript type definitions \
37+ 📦 Published as an npm package \
38+ 👩⚖️ [ 0BSD licensed] template
39+
3440## Installation
3541
42+ ![ npm] ( https://img.shields.io/static/v1?style=for-the-badge&message=npm&color=CB3837&logo=npm&logoColor=FFFFFF&label= )
43+ ![ Yarn] ( https://img.shields.io/static/v1?style=for-the-badge&message=Yarn&color=2C8EBB&logo=Yarn&logoColor=FFFFFF&label= )
44+ ![ pnpm] ( https://img.shields.io/static/v1?style=for-the-badge&message=pnpm&color=222222&logo=pnpm&logoColor=F69220&label= )
45+ ![ Deno] ( https://img.shields.io/static/v1?style=for-the-badge&message=Deno&color=000000&logo=Deno&logoColor=FFFFFF&label= )
46+ ![ Bun] ( https://img.shields.io/static/v1?style=for-the-badge&message=Bun&color=000000&logo=Bun&logoColor=FFFFFF&label= )
47+ ![ jsDelivr] ( https://img.shields.io/static/v1?style=for-the-badge&message=jsDelivr&color=E84D3D&logo=jsDelivr&logoColor=FFFFFF&label= )
48+
49+ You can install this package using your favorite npm package manager like npm,
50+ [ Yarn] , [ pnpm] , or [ Bun] .
51+
3652``` sh
3753npm install hello-world-rust-wasm-component-lib
3854```
3955
56+ If you're using [ Deno] you can import it straight from npm:
57+
58+ ``` js
59+ import {} from " npm:hello-world-rust-wasm-component-lib" ;
60+ ```
61+
62+ If you prefer to go buildless in the browser you can use an npm CDN like
63+ [ jsDelivr] or [ esm.sh] .
64+
65+ ``` html
66+ <script type =" module" >
67+ import {} from " https://esm.run/hello-world-rust-wasm-component-lib" ;
68+ </script >
69+ ```
70+
4071## Usage
4172
73+ ![ Node.js] ( https://img.shields.io/static/v1?style=for-the-badge&message=Node.js&color=339933&logo=Node.js&logoColor=FFFFFF&label= )
74+ ![ Deno] ( https://img.shields.io/static/v1?style=for-the-badge&message=Deno&color=000000&logo=Deno&logoColor=FFFFFF&label= )
75+ ![ Bun] ( https://img.shields.io/static/v1?style=for-the-badge&message=Bun&color=000000&logo=Bun&logoColor=FFFFFF&label= )
76+ ![ Browser] ( https://img.shields.io/static/v1?style=for-the-badge&message=Browser&color=4285F4&logo=Google+Chrome&logoColor=FFFFFF&label= )
77+
78+ You should be able to just import and use this JavaScript package like any
79+ other. The WASM magic is hidden behind a really nice wrapper layer.
80+
4281``` js
4382import {
44- greet ,
4583 greetMany ,
4684 run ,
4785 getReport ,
4886 computeArea ,
49- } from " ./dist/hello_world_rust_wasm_component_lib.js " ;
87+ } from " hello-world-rust-wasm-component-lib " ;
5088
5189run ();
5290// => Hello Alan Turing!
@@ -66,3 +104,29 @@ console.log(greetMany(["Alan Turing", "Ada Lovelace"]));
66104// => Hello, Alan Turing!
67105// Hello, Ada Lovelace!
68106```
107+
108+ [ 📚 Read more about the API surface on the documentation website] ( https://tsdocs.dev/docs/hello-world-rust-wasm-component-lib )
109+
110+ ## Development
111+
112+ ![ Node.js] ( https://img.shields.io/static/v1?style=for-the-badge&message=Node.js&color=339933&logo=Node.js&logoColor=FFFFFF&label= )
113+ ![ JavaScript] ( https://img.shields.io/static/v1?style=for-the-badge&message=JavaScript&color=222222&logo=JavaScript&logoColor=F7DF1E&label= )
114+
115+ ** Versioning scheme:** Use ` 1.2.3+4.5.6 ` where ` 1.2.3 ` is the main JS bindings
116+ API version (this package) and ` 4.5.6 ` is the version of the upstream WASM
117+ underlying library that was used to generate the JavaScript bindings. The
118+ ` 1.2.3+4.5.6 ` versioning scheme was adopted so that users of a particular
119+ version can quickly see which version of the WASM library was used. Note that
120+ the ` +4.5.6 ` part is ** just metadata** . You can't publish both ` 1.2.3+4.5.6 ` and
121+ ` 1.2.3+7.8.9 ` . Think of it like a super important ` "description" ` field.
122+
123+ <!-- prettier-ignore-start -->
124+ [ jcbhmr/hello-world-rust-wasm-component-lib ] : https://github.com/jcbhmr/hello-world-rust-wasm-component-lib
125+ [ Yarn ] : https://yarnpkg.com/
126+ [ pnpm ] : https://pnpm.io/
127+ [ Bun ] : https://bun.sh/
128+ [ Deno ] : https://deno.com/
129+ [ jsDelivr ] : https://www.jsdelivr.com/
130+ [ esm.sh ] : https://esm.sh/
131+ [ 0BSD licensed ] : https://github.com/jcbhmr/hello-world-rust-wasm-component-lib.js/blob/main/LICENSE
132+ <!-- prettier-ignore-end -->
0 commit comments