A sample project which uses Webpack and Babel with appropriate settings for Espruino.
Highly recommend installing nvm to enable easy installation of different Node runtimes.
Install/use node for this project:
nvm install
nvm use
Install dependencies:
npm i
Build the project:
npm run build
Upload to microcontroller (using WebIDE or espruino CLI). e.g. Using the command line. (Note: Your port and baud rate may vary).
espruino -b 115200 -p /dev/cu.SLAB_USBtoUART dist/entry.bundle.js
I have not done comprehensive testing that ensures that all code is compiled or executes as expected.
If you run into any issues, please consider raising an issue here or in the official Espriuno repository.
Many thanks to the Espruino team for making this possible. It's been a real pleasure to get such quick results.
nvm is released under the MIT license.
For reference, the following output is expected:
value (inside-block): is-inside
value (outside-block): is-outside
{
"a": 1,
"b": 2,
"c": 3,
"d": 4,
"e": 5,
"f": 6
}
{
"age": 34,
"name": "Jane Doe"
}
wheels: 4 color: yellow
A default parameter: default-value
=Promise { }
After 2 seconds, promise results: first-promise second-promise