Tested with .Net SDK version 9.0.200, Bun 1.2.4, Deno 2.2.2, Node.js 22.14.0, RestSharp v112.1.0.
- Open this repo in devcontainer, e.g. using Github Codespaces. Type or copy/paste following commands to devcontainer's terminal.
cd
into the folder of this example:
cd browser-and-node-RestSharp/node
- Create new .Net project using
wasmconsole
template:
dotnet new wasmconsole -n NodeProject
- Replace generated HelloWorld-like
Program.cs
andmain.mjs
with HTTP-enabled ones:
cp ../Program.cs ./NodeProject/
cp ../main.js ./NodeProject/main.mjs
cd
into the folder of the new .Net project to use it:
cd NodeProject
- Install RestSharp library as dependency:
dotnet add package RestSharp
- Compile the example:
dotnet build
- Run the configuration:
dotnet run
Or, alternatively, the same by directly using node
command:
node bin/Debug/net9.0/browser-wasm/AppBundle/main.mjs
- Install Bun:
curl -fsSL https://bun.sh/install | bash
- Run with Bun:
~/.bun/bin/bun bin/Debug/net9.0/browser-wasm/AppBundle/main.mjs
- Install Deno:
curl -fsSL https://deno.land/install.sh | bash -s -- --yes
- Run with Deno:
~/.deno/bin/deno run --allow-read --allow-net --unstable-bare-node-builtins bin/Debug/net9.0/browser-wasm/AppBundle/main.mjs
Perform your own experiments if desired.