I get quite frustrated running JS by pasting into Chrome/FF and sometimes I like to keep everything local. These are some notes on using Apple's built in intrerpreter, node or phantom.
sudo ln -s /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc /usr/bin
jsc
Create a file and save it. Change to the saved directory and execute the file:
jsc hello.js
brew update && brew install node
node
Create a file and save it. Change to the saved directory and execute the file:
node hello.js
brew update && brew install phantomjs
phantomjs
Create a file and save it. Change to the saved directory and execute the file:
phantomjs hello.js
I'm trying to run a single line of JavaScript in the command prompt. How can it be possible? or again i have to read the command output in the javascript!