更新时间:2021-08-27 02:22:46
这篇文章的补充,JSC居住在
/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc
,默认情况下不在外壳PATH
中.您可以使用
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
将文件名作为参数.您可以使用
jsc
takes filenames as arguments. You could run a file named demo.js
with
jsc demo.js
请注意,您必须在脚本中使用debug()
而不是常规的console.log()
来查看任何输出.
Note that you'll have to use debug()
instead of the conventional console.log()
in your script to see any output.