Node.js is just JavaScript running on the server side. That's it. That's all there is to it.
- Express Docs, if you want to get started and already know JavaScript this is the place to be
Node.js is just JavaScript running on the server side. That's it. That's all there is to it.
MyApp = 42; | |
(function() { | |
if (typeof MyApp === 'undefined') { | |
var MyApp = { oops: true }; | |
} | |
console.log(MyApp); | |
}()); |
Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.
Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.
On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation
// Be explicit - provide names for everything. | |
(function(window) { | |
/** | |
* The ToolBox | |
* | |
* @class ToolBox | |
*/ | |
var ToolBox = {}; | |
/** |