Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

README.md: use pipe in example

  • Loading branch information...
commit 5b5fa7237f146188ddd57f584d1bdc4b45f9f75c 1 parent b3979e0
Dominic Tarr dominictarr authored committed

Showing 1 changed file with 11 additions and 13 deletions. Show diff stats Hide diff stats

  1. +11 13 README.md
24 README.md
Source Rendered
@@ -10,16 +10,14 @@ Example Usage:
10 10 var e = new EncryptStream(key);
11 11 var d = new DecryptStream(key);
12 12
13   - e.addListener('data', function(chunk) {
14   - d.write(chunk);
15   - });
16   - e.addListener('end', function() {
17   - d.end();
18   - });
19   - d.addListener('data', function(chunk) {
20   - if (chunk.length > 0)
21   - console.log('data: ' + chunk);
22   - });
23   -
24   - e.write("Hello world", 'binary');
25   - e.end();
  13 + fs.createReadStream(__filename).pipe(e).pipe(d).pipe(process.stdout, {end: false})
  14 +
  15 +EncryptStream/DecryptStream (opts)
  16 +
  17 +`opts` may be a the key (string) or a object. If `opts` is an object it _must_
  18 +have properties for `key` and `algorithm`, and _may_ have properties
  19 +`inputEncoding` and `outputEncoding`
  20 +
  21 +also see [crypto.createCypher][createCypher]
  22 +
  23 +[createCypher]: http://nodejs.org/api/crypto.html#crypto_crypto_createcipher_algorithm_password

0 comments on commit 5b5fa72

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