2

How to execute JavaScript file by ant and redirect stdout and stderr to files?
For example let say we have

helloWorld.js

console.log('Hello world!');  

I need ant target to proudce

stdout.txt

Hello world!

It is acceptable to create temporary HTML file that include needed JavaScript file and then execute tmp.html, but I would like to omit this step if possible.

2 Answers 2

1

You can use Rhino to execute Javascript from ant. See this question or any of these questions for examples.

Sign up to request clarification or add additional context in comments.

Comments

1

Node.js would help with this. No HTML necessary.

Comments

Your Answer

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.