NodeJS Series #3: Using External Files


Hello Wizards,

This time we will create external .js files to call from NodeJS Command Prompt.

Create a new .js file (for instance I’ve created sample.js).
Add these javascript lines as an example:


When we call external file from nodejs command prompt,it shall write “Pooff” as an output.

Store this file to a close destination,easy to access later from command prompt.Now open “Nodejs Command Prompt” application and call this:


Then press enter and see what happens.According to me,I get this one:


Its that easy to call external files with Nodejs.

Do you want much more complicated and real-life solution? Wait for tomorrow, Wizards 🙂

I shall show you how to listen to a port tomorrow.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s