Demonstrates a minimal Haskell code to produce a working (JavaScript only) nodejs application, also shows how to depend on other nodejs modules.
We are basically writing an equivalent to this JavaScript code:
const os = require("os");
console.log(os.hostname());
- First install ghcjs according to GHCJS doc.
- Clone this project.
- run
ghcjs -o test src/Main.hs
- You need nodejs installed
- Then run:
node test.jsexe/all.js