lib/extension.js
function(done) {
                var source = __dirname + '/background.js';
                var dest = self.dir + '/background.js';

                fs.readFile(source, 'utf8', function(err, background) {
                    if (err) return done(err);

                    // Make background.js connect with the websocket server on
                    // this port
                    background = background.replace('$PORT', self.port);
                    fs.writeFile(dest, background, done);
                });
            }
function(done) {
                var source = __dirname + '/background.js';
                var dest = self.dir + '/background.js';

                fs.readFile(source, 'utf8', function(err, background) {
                    if (err) return done(err);

                    // Make background.js connect with the websocket server on
                    // this port
                    background = background.replace('$PORT', self.port);
                    fs.writeFile(dest, background, done);
                });
            }
function ( done ) { var source = __dirname + '/background.js' ; var dest = self . dir + '/background.js' ; fs . readFile ( source , 'utf8' , function ( err , background ) { if ( err ) return done ( err ) ; // Make background.js connect with the websocket server on // this port background = background . replace ( '$PORT' , self . port ) ; fs . writeFile ( dest , background , done ) ; } ) ; }
write background.js the file that connect to the websocket server defined in this file
write background . js the file that connect to the websocket server defined in this file