diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..c69f402 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,6 @@ +{ + "curly": true, + "eqeqeq": true, + "undef": true, + "node": true +} diff --git a/bin/crx.js b/bin/crx.js index 8c5da58..99c49d8 100755 --- a/bin/crx.js +++ b/bin/crx.js @@ -13,7 +13,7 @@ var join = path.join; var cwd = process.cwd(); -program.version(pkg.version) +program.version(pkg.version); // coming soon // .option("-x, --xml", "output autoupdate xml instead of extension ") @@ -52,8 +52,8 @@ function keygen (dir, program) { } console.log('%s has been generated in %s', 'key.pem', dir); - }) - }) + }); + }); } function pack (dir, program) { diff --git a/src/crx.js b/src/crx.js index 56231d6..da60856 100644 --- a/src/crx.js +++ b/src/crx.js @@ -1,3 +1,4 @@ +/* global require, process, Buffer, module */ 'use strict'; var fs = require("fs"); @@ -181,7 +182,7 @@ ChromeExtension.prototype = { var allFiles = []; if (!selfie.loaded) { - throw new Error('crx.load needs to be called first in order to prepare the workspace.') + throw new Error('crx.load needs to be called first in order to prepare the workspace.'); } // the callback is called many times @@ -244,7 +245,7 @@ ChromeExtension.prototype = { var crx = new Buffer(length); - crx.write("Cr24" + Array(13).join("\x00"), "binary"); + crx.write("Cr24" + new Array(13).join("\x00"), "binary"); crx[4] = 2; crx.writeUInt32LE(keyLength, 8); @@ -294,7 +295,7 @@ ChromeExtension.prototype = { throw new Error("No URL provided for update.xml."); } - return Buffer( + return new Buffer( "\n" + "\n" + " \n" + diff --git a/test/index.js b/test/index.js index 0e61e5e..0f4c014 100644 --- a/test/index.js +++ b/test/index.js @@ -1,3 +1,6 @@ +/* global require, __dirname, Buffer */ +'use strict'; + var fs = require("fs"); var test = require("tape"); var ChromeExtension = require("../");