Use the d8 shell to run the v8 engine. Use the following pattern to run on a file:
/path/to/d8 [flags] [file].js
For example:
./d8 --log-gc script.js
will run d8 on script.js with garbage collection logging enabled