[beagleboard] trying to use node-sqlite-purejs in Cloud9 - getting errors

I created a new folder under Cloud9 and copied the files from the js folder
of node-sqlite-purejs there. Then I tried a really simple sample program. I
get an "unexpected token" on the closing brace. I am not a javascript pro,
but I can count braces and it looks right and it came straight from the
distribution. Anyway, below is the script followed by what I get as output
when I try to run/debug. I set a breakpoint on the sql.open line to be sure
this is compilation and not execution.

var sql = require('./node-sqlite-purejs.js');

sql.open('db.sql', {}, function(err, db) {
  if (!err) {
    db.exec("SELECT * FROM users",
            // this callback prints the whole result on the console
            function(err, result) {
              if (err)
                console.log('Error: ' + err);

debugger listening on port 6293
  var compiledWrapper = runInThisContext(wrapper, filename, true);
SyntaxError: Unexpected token }

When the tools tell you have a syntax error, that's typically a pretty
good hint you have a syntax error.

If you simply match your brackets, you can see that the ')' is
expected to close 'db.exec(' before you try to close 'if (!err) {'.
You're still missing the outer '});' for 'sql.open('db.sql', {},
function(err, db) {' as well.

For learning JavaScript, I find JavaScript Tutorial to be
rather useful.