To save space and be able to run JerryScript on an embedded device, this library builds without parser support.
This can be done during normal compilation and flashing, or indirectly via web application.
Manual compilation method
You should have your device connected physically to your computer via USB cable.
In this case the compilation will be done on your computer and the compiled files will be saved to your device.
.js files in the
APP_JS_SOURCE_DIR directory will be compiled into
.snap files and written to
make APP_JS_SOURCE_DIR=files/js APP_JS_SNAP_DIR=out/web
In this advanced sample the variables are directly stored in
The generated .snap files may be flashed or uploaded to your device for execution via any appropriate mechanism.
Web Browser compilation method
The advanced sample starts a web server with a simple page.
In it you will see the initial source code of the
If you press
Run you will be able to see the result from the execution in the device terminal.
If you have your device connected to your computer then type the following to see the output:
Do directly in the browser the desired changes and press
then it will be compiled directly in your browser and sent to your device.
Again no external tools are required - just a modern browser.
After that you can press
Run in the browser and enjoy the modified result in the terminal.
The initial work on the JerryScript library for Sming was done as part of the U:Kit project.