Reputation: 1250
I can run script.js from the commandline with node script.js.
script.js
node script.js
When I just type node I enter the interactive console and see a prompt. How can I execute script.js from there?
node
Upvotes: 1
Views: 153
Reputation: 310993
One option is to require it:
require
require('./script')