7

I'm a newbie JavaScript programmer who wants to experiment with server side JavaScript using Node.Js on my Mac I downloaded NodeJs and the wizard installed it, but now I can't see it in my applications?

1) How do I open it and start using it? Do I do it from the command line? if so, how do I start?

2) Can I connect it to a MySQL database I have installed with MAMP?

Thanks if you can help

3
  • node filename from the command line. Commented Apr 3, 2011 at 4:51
  • I forked an incomplete ebook on github and I've added a lot of content: github.com/jimschubert/masteringnode It talks a bit about installing node and packages, and how to begin working with node. Original repo for the ebook is here: github.com/visionmedia/masteringnode Commented Apr 3, 2011 at 13:50
  • Also, browse to docs/book.pdf and click raw, then you don't need to clone the whole repo. I regenerated the book about a week ago, so it's probably only missing the http server section. Commented Apr 3, 2011 at 13:52

2 Answers 2

5

To start node, you open a terminal and type:

/path/to/node scriptname.js

Depending on how you installed node, the actual location of node may vary. You should figure that out. You should probably add that path to your PATH environment variable. If you do this then you can simply type

node scriptname.js

There are plenty of samples around the net. As for mysql connectivity, check this out.

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

Comments

1

I am in pretty much in the same boat as you are, and I highly recommend you to watch the meetup talk by Ryan Dahl on http://nodejs.org/

It is only about an hour long, but it pretty shows you how you can use it for your own non-blocking applications.

In terms of driver for accessing SQL, you will need to install NPM http://npmjs.org/ You can do a quick search http://search.npmjs.org/, on the support for MySQL. Because node.js is still relatively new to the scene, you will see quite a bit of choices competing to meet your goal

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.