In this notebook, we'll be transforming an SVG-file to the PNG format.
First of all, we import 'Sharp' into our notebook. Sharp is a small image library for Node.js, which depends on 'libvips' (which is already pre-installed on most systems out there...)
exec() spawns a shell and executes the command within that shell. Any generated output gets buffered.
Unlike spawn(), the command is entered as a single string, without any array containing parameters.
spawn() spawns a new process using the given command, with any command line arguments passed into an array.
Unlike exec(), no extra shell gets spawned, so that output is not buffered, but caught via event handlers.
fork() is a special case of spawn(), used exclusively to spawn new Node.js processes.
These processes are equipped with their own memory stack and V8 engine, therefore they are as well completely decoupled from the parent process. The only way to communicate with the parent process is done via the built-in communication channel.