I am a .net developer by trade. While I wait for Microsoft to ease up on constantly reinventing the v.next. I thought I would have a look at nodejs. I have worked through a number of small tutorials and it seems to be going smoothly.
One thing I am having trouble with is understanding what data is being passed around and how to read function headers. I would imagine this is because it is a dynamic language (Javascript) were as all my experience has been in static languages.
Are there any tutorials / other, that talk about this portion of development, that is the structure of nodejs / Javascript which would make it more clear how to develop correctly in a dynamic language?
First of all it is good to know that almost every Node API follows the same convention for registering callbacks, calling them and passing around errors and data. For example...
fs.readFile(path, function (err, data) {
if (err) { throw err; }
// Do something with the data
console.log("Data is a buffer", data);
console.log("Data as a string", data.toString());
});
What you see in this example is that the first param of the callback is always an error object and the subsequent parameters contain the data. If you want to know what kind of data you will get you need to check the documentation of a given API. This can be the found in the Node.JS Docs or the documentation of the module that you are using.
Node modules are an important aspect in NodeJS for structuring, abstracting and isolating your code. Every module provides a clear boundary between the implementation and the user. Isaac Z. Schlueter (creator of the Node Package Manager) wrote a nice article on building modules.
The best way to learn node is to look at other people's modules. Because most of them are written in pure JavaScript you can open up the code and see the implementation.
There are also a lot of good videos to watch...
Let me know if you want know more specific things about node where I can help you with.