0

Possible Duplicate:
How to exit in Node.JS

I'm using node.js to import some data in the background and I'll have the script running every other day in the background using cron. I don't need it to listen. How do I exit the node script after it runs? Should I use process.exit() or is there a better way?

Community
  • 1
  • 1
jabbermonkey
  • 1,680
  • 4
  • 19
  • 37

1 Answers1

2

If it's not bound to a database or listing on a port it will automatically close. If you are connected to a database and need to shut down the process then use process.exit(); after cleaning up the connections.

surendrapanday
  • 530
  • 3
  • 13
Jason Brumwell
  • 3,482
  • 24
  • 16