By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,743 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,743 IT Pros & Developers. It's quick & easy.

SpiderMonkey standalone commandline & stdio

P: n/a
1) Running a standalone script with SpiderMonkey on Linux
js -f scriptfile.js scriptarg

How can I get the value of scriptarg from within the JavaScript
scriptfile?
2) Running a standalone script with SpiderMonkey on Linux

How can I do formated printing to stdout?

(I see that /js/src/perfect.js uses print() is there an equivalent for
printing formated reals?)
3) Running a standalone script with SpiderMonkey on Linux

How can I read from stdin?
best wishes, Isaac

Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a


Isaac Gouy wrote:
1) Running a standalone script with SpiderMonkey on Linux
js -f scriptfile.js scriptarg

How can I get the value of scriptarg from within the JavaScript
scriptfile?
I just stumbled on the first answer :-)
arguments[0] arguments[1] ...

2) Running a standalone script with SpiderMonkey on Linux

How can I do formated printing to stdout?

(I see that /js/src/perfect.js uses print() is there an equivalent for
printing formated reals?)
3) Running a standalone script with SpiderMonkey on Linux

How can I read from stdin?
best wishes, Isaac


Jul 23 '05 #2

P: n/a
> 2) Running a standalone script with SpiderMonkey on Linux

How can I do formated printing to stdout?

(I see that /js/src/perfect.js uses print() is there an equivalent for
printing formated reals?)


toPrecision() is almost what I was looking for

Jul 23 '05 #3

P: n/a
Is there a way to make a standalone SpiderMonkey JavaScript script read
from stdin?

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.