Skip to content

Instantly share code, notes, and snippets.

@WebReflection
Last active August 12, 2019 18:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save WebReflection/35e61b9dbb4987e288f256aae73b3a5c to your computer and use it in GitHub Desktop.
Save WebReflection/35e61b9dbb4987e288f256aae73b3a5c to your computer and use it in GitHub Desktop.
JavaScriptCore for macOS and Linux
#!/usr/bin/env bash
if [ -f /usr/lib/jsc ]; then
/usr/lib/jsc "$@"
elif [ -f /System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc ]; then
/System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc "$@"
fi
@WebReflection
Copy link
Author

WebReflection commented Feb 6, 2018

To make it an executable:

curl -LO https://gist.githubusercontent.com/WebReflection/35e61b9dbb4987e288f256aae73b3a5c/raw/ebb8bdf763b80ff52e3b81e49592ded12a488c18/jsc
chmod a+x jsc
sudo mv jsc /usr/local/bin/

@LeetCodes
Copy link

how is this for Linux?

@WebReflection
Copy link
Author

@LeetCodes it's JavaScriptCore provided by GNOME Web, so it's yet another JS interpreter you can use from console.
Did I answer your question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment