The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,512 other followers

Mac OS X: How do you run JavaScript script through the Terminal? (via: Stack Overflow)

Posted by jpluimers on 2014/02/11

Now I have these aliases in my ~/.bash_profile:

alias jsc='/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc'
alias JavaScript='/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc'

Now I can use the WebKit jsc from the console.

Thanks User microspino – Stack Overflow for this answer:

If you have a Mac you can get jsc a javascript console in OS X (Terminal) by typing

/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc

in Terminal.app.

You could also run one of your .js script by adding its name as an argument for jsc, like this:

jsc your_awesome_script_name.js

Notice: I use console.log() during development but jsc needs the debug() function instead.

–jeroen

via: How do you run JavaScript script through the Terminal? – Stack Overflow.

One Response to “Mac OS X: How do you run JavaScript script through the Terminal? (via: Stack Overflow)”

  1. […] Mac OS X: How do you… on Mac OS X: editing ~/.bash_prof… […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: