Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated README

  • Loading branch information...
commit d8d42265d5c2a09852623342bc6cf65809c37aa4 1 parent 40dbb98
@chriso authored
Showing with 12 additions and 12 deletions.
  1. +11 −11 README.md
  2. +1 −1  packnode
View
22 README.md
@@ -1,4 +1,4 @@
-Packnode encrypts node modules for private use
+`packnode` encrypts node modules for private use
To install packnode, use [npm](http://github.com/isaacs/npm)
@@ -10,16 +10,6 @@ To pack a module using a password (e.g. `pass123`), run
$ cat myscript.js | packnode pass123 > packed.js
-CoffeeScript modules can be packed using
-
- $ cat myscript.coffee | coffee -c -s | packnode pass123 > packed.js
-
-To specify a custom encryption algorithm or output encoding, use `-a` and `-e`
-
- $ packnode -a aes256 -e hex < myscript.js > packed.js
-
-## Using a packed module
-
Encrypted modules can be accessed by calling `unpack(password)`
require('./packed').unpack('pass123'); //Same as require('./myscript')
@@ -54,3 +44,13 @@ Running both modules
require('./hello1').world(); //Outputs 'Hello world!'
require('./hello2').unpack('pass123').world(); //Outputs 'Hello world!'
+
+## Advanced
+
+CoffeeScript modules can be packed using
+
+ $ cat myscript.coffee | coffee -c -s | packnode pass123 > packed.js
+
+To specify a custom encryption algorithm or output encoding, use `-a` and `-e`
+
+ $ packnode -a aes256 -e hex < myscript.js > packed.js
View
2  packnode
@@ -68,7 +68,7 @@ stdin.on('end', function () {
// Prepare the output
packed = 'var crypto = require("crypto");\n'
- packed += 'packed = "' + chunk.join('";\npacked += "') + '";\n';
+ packed += 'packed = "' + chunk.join('";\npacked += "') + '";\n';
packed += 'exports.unpack = function (password) {\n';
packed += ' var decipher = crypto.createDecipher("' + algorithm + '", password);\n';
packed += ' exports = (function (exports, packed) {\n';
Please sign in to comment.
Something went wrong with that request. Please try again.