Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated README

  • Loading branch information...
commit d8d42265d5c2a09852623342bc6cf65809c37aa4 1 parent 40dbb98
Chris O'Hara authored

Showing 2 changed files with 12 additions and 12 deletions. Show diff stats Hide diff stats

  1. +11 11 README.md
  2. +1 1  packnode
22 README.md
Source Rendered
... ... @@ -1,4 +1,4 @@
1   -Packnode encrypts node modules for private use
  1 +`packnode` encrypts node modules for private use
2 2
3 3 To install packnode, use [npm](http://github.com/isaacs/npm)
4 4
@@ -10,16 +10,6 @@ To pack a module using a password (e.g. `pass123`), run
10 10
11 11 $ cat myscript.js | packnode pass123 > packed.js
12 12
13   -CoffeeScript modules can be packed using
14   -
15   - $ cat myscript.coffee | coffee -c -s | packnode pass123 > packed.js
16   -
17   -To specify a custom encryption algorithm or output encoding, use `-a` and `-e`
18   -
19   - $ packnode -a aes256 -e hex < myscript.js > packed.js
20   -
21   -## Using a packed module
22   -
23 13 Encrypted modules can be accessed by calling `unpack(password)`
24 14
25 15 require('./packed').unpack('pass123'); //Same as require('./myscript')
@@ -54,3 +44,13 @@ Running both modules
54 44
55 45 require('./hello1').world(); //Outputs 'Hello world!'
56 46 require('./hello2').unpack('pass123').world(); //Outputs 'Hello world!'
  47 +
  48 +## Advanced
  49 +
  50 +CoffeeScript modules can be packed using
  51 +
  52 + $ cat myscript.coffee | coffee -c -s | packnode pass123 > packed.js
  53 +
  54 +To specify a custom encryption algorithm or output encoding, use `-a` and `-e`
  55 +
  56 + $ packnode -a aes256 -e hex < myscript.js > packed.js
2  packnode
@@ -68,7 +68,7 @@ stdin.on('end', function () {
68 68
69 69 // Prepare the output
70 70 packed = 'var crypto = require("crypto");\n'
71   - packed += 'packed = "' + chunk.join('";\npacked += "') + '";\n';
  71 + packed += 'packed = "' + chunk.join('";\npacked += "') + '";\n';
72 72 packed += 'exports.unpack = function (password) {\n';
73 73 packed += ' var decipher = crypto.createDecipher("' + algorithm + '", password);\n';
74 74 packed += ' exports = (function (exports, packed) {\n';

0 comments on commit d8d4226

Please sign in to comment.
Something went wrong with that request. Please try again.