Why does the JavaScript need to start with “;”?

I would say since scripts are often concatenated and minified/compressed/sent together there’s a chance the last guy had something like: return { ‘var’:’value’ } at the end of the last script without a ; on the end. If you have a ; at the start on yours, it’s safe, example: return { ‘var’:’value’ } ;(function( … Read more

user authentication libraries for node.js?

If you are looking for an authentication framework for Connect or Express, Passport is worth investigating: https://github.com/jaredhanson/passport (Disclosure: I’m the developer of Passport) I developed Passport after investigating both connect-auth and everyauth. While they are both great modules, they didn’t suit my needs. I wanted something that was more light-weight and unobtrusive. Passport is broken … Read more

nodejs vs node on ubuntu 12.04

You need to manually create a symlink /usr/bin/node. Shortcut for bash compatible shells: sudo ln -s `which nodejs` /usr/bin/node Or if you use non-standard shells, just hardcode the path you find with which nodejs: sudo ln -s /usr/bin/nodejs /usr/bin/node Later edit I found this explanation in the link you posted There is a naming conflict … Read more

Node.js Best Practice Exception Handling

Update: Joyent now has their own guide. The following information is more of a summary: Safely “throwing” errors Ideally we’d like to avoid uncaught errors as much as possible, as such, instead of literally throwing the error, we can instead safely “throw” the error using one of the following methods depending on our code architecture: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)