4

Can you run a node.js script:

node app.js --watch ../worker/storage/work

like this?

app --watch ../worker/storage/work
1
  • I've been wondering about this one for a while...+1 Commented Dec 28, 2013 at 4:31

2 Answers 2

2
  1. Add #!/path/to/your/node at the first line of your js file.

  2. Then run:

    chmod +x yourFileName
    

    to add execute permission to your script.

  3. At last run your file like this:

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

1 Comment

Just for kicks I removed the .js and can now run it as ./app. forever start ./app works as well just as a side note.
2

One way this could work is by creating an alias in your shell. Edit your ~/.bashrc file and add the following line:

alias app="node app.js"

More details on how to create a permanent alias: https://askubuntu.com/questions/1414/how-to-create-a-permanent-alias

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.