Permalink
Browse files

Slight minification, added -v and version bump

  • Loading branch information...
chriso committed Dec 21, 2010
1 parent 55f3769 commit 60ed3ac70b2f627376ea4b9ffdbb3dd193f6b3c4
Showing with 10 additions and 5 deletions.
  1. +1 −1 README.md
  2. +8 −3 lib/packnode.js
  3. +1 −1 package.json
View
@@ -1,4 +1,4 @@
-packnode minifies, obfuscates and/or encrypts node modules for private use.
+**packnode minifies, obfuscates and/or encrypts node modules for private use.**
To install packnode, use [npm](http://github.com/isaacs/npm)
View
@@ -8,7 +8,7 @@ var stdin = process.openStdin(), input = '';
var cipher, data = '', encrypted, out,
packed, decipher, password, unpack,
encoding = 'hex', algorithm = 'aes256',
- chunk_length = 80, chunk = [];
+ chunk_length = 120, chunk = [];
var exit = function (msg, is_error) {
console.log(msg);
@@ -26,6 +26,7 @@ var usage = ''
+ ' -a, --algorithm <..> Use the specified algorithm. Default is "aes256"\n'
+ ' -e, --encoding <..> Encode with base64|hex|binary. Default is "hex"\n'
+ ' -u, --unpack Unpack the module using the specified password\n'
+ + ' -v, --version Display the current version\n'
+ ' -h, --help Display help information\n'
;
@@ -72,6 +73,10 @@ exports.pack = function () {
case '--help':
exit(usage);
break;
+ case '-v':
+ case '--version':
+ exit('packnode v0.2.2');
+ break;
default:
password = arg;
break;
@@ -103,8 +108,8 @@ exports.pack = function () {
// Prepare the output
out = 'e="' + chunk.join('"\n+"') + '";\n';
- out += 'exports.unpack=function(p){var d=require("crypto").createDecipher("' + algorithm + '",p);\n';
- out += 'eval(d.update(e,"' + encoding + '","utf8")+d.final("utf8"));return exports;}';
+ out += 'exports.unpack=function(p){var d=require("crypto").createDecipher("' + algorithm + '",p);';
+ out += 'eval(d.update(e,"' + encoding + '","utf8")+d.final("utf8"));return exports}';
// ..and write to stdout
process.stdout.write(out);
View
2 package.json 100644 → 100755
@@ -1,6 +1,6 @@
{ "name" : "pack",
"description" : "Minify, obfuscate and encrypt node modules",
- "version" : "0.2.1",
+ "version" : "0.2.2",
"homepage" : "http://github.com/chriso/packnode",
"keywords" : ["pack","packnode","encrypt","compress","unpack","yui","obfuscate","compressor","closure","jsmin"],
"author" : "Chris O'Hara <cohara87@gmail.com>",

0 comments on commit 60ed3ac

Please sign in to comment.