I got this when I was trying to find some way to run my JavaScript programs through terminal. The run and load command mentioned can execute external J
Complements of this post, JSC lives at
/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc
and is not in the shell PATH by default. You can fix that with
ln -s /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc /usr/local/bin
jsc takes filenames as arguments. You could run a file named demo.js with
jsc demo.js
Note that you'll have to use debug() instead of the conventional console.log() in your script to see any output.