[EXPERIMENTAL] Do not use
cli tools for building node project with webr inside
npm install -g webrcli
webrcli --version
- Initiate and configure a project:
webrcli init ./mywebrapp
- Download a webR compiled package and its dependencies:
webrcli install cowsay
- Read a DESCRIPTION file and build the webR package library
webrcli installFromDesc $(pwd)/rfuns/DESCRIPTION
cd /tmp
webrcli init cowsaywebr
cd cowsaywebr
webrcli install cowsay
Modify the index.js with this line juste before the end of the function
await globalThis.webR.evalR('cowsay::say("Hello from R!")');
Then run
node index.js