2

I'm looking at writing some code in Javascript to run as a command line program, unrelated to browsers or the Web; it would need access to files and directories as normal for a command line utility. What's the best Windows implementation of Javascript for this scenario, with regard to stability and performance?

asked Jun 14, 2011 at 9:20

2 Answers 2

4

I would take a look at Nodejs

answered Jun 14, 2011 at 9:22
Sign up to request clarification or add additional context in comments.

7 Comments

Node.js may be too much for rwallace's needs, but V8, which Node.js runs on, might be a simpler alternative. Node.js is for writing servers, and I think V8 may be more appropriate for this use.
Right, I don't need the server framework, but V8 definitely looks like a strong contender. I'd be interested if anyone knows how it stacks up against the alternatives.
@Wylie true, but V8 isn't a commandline app in itself. You'd have to compile a wrapper to V8 to process a script and run it. Node does have an API for server stuff, but it's equally well equipped to do local file I/O; the same is true of many scripting languages like Ruby and Python so I wouldn't let that put you off.
V8 is an engine more than an api. I'm not aware of there being native support for the types of operations you mentioned - e.g. file I/O. Yes, Node is primarily looked at for it's server capabilities, but it is more of a developed api than going straight to V8. Maybe there are some other apis written to run on v8 I don't know about yet, but I'm not sure working with v8 directly is the way you want to go.
Correction to my own comment - V8 does come with a shell. I'm not sure how much of a file IO API you get with plain V8, so Node may still be worth looking at.
|
3

I use jsdb or in windows cscript. In some editors (Editplus in my case, i've also use Aptana) you can configure running js-files directly from within the editor.

Ofcourse in jsfiddle.net you could create javascript unrelated to the browser (apart from the output, which can be [console.]logged or written to some div. In some cases it can be a problem that the code is evalled though.

Further, this blog entry may give you extra information

answered Jun 14, 2011 at 9:55

1 Comment

Any link to Stoyan's site is a +1 from me :)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.