How to run JavaScript using jsc on OS X?

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)