471,082 Members | 906 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,082 software developers and data experts.

SpiderMonkey standalone commandline & stdio

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
3 2732


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
> 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
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.

Similar topics

7 posts views Thread by brian.vincent | last post: by
2 posts views Thread by Christoph Borger | last post: by
3 posts views Thread by pemo | last post: by
6 posts views Thread by Chad Crabtree | last post: by
2 posts views Thread by zowtar | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.