Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

README.md: use pipe in example

  • Loading branch information...
commit 5b5fa7237f146188ddd57f584d1bdc4b45f9f75c 1 parent b3979e0
Dominic Tarr dominictarr authored committed
Showing with 11 additions and 13 deletions.
  1. +11 −13 README.md
24 README.md
View
@@ -10,16 +10,14 @@ Example Usage:
var e = new EncryptStream(key);
var d = new DecryptStream(key);
- e.addListener('data', function(chunk) {
- d.write(chunk);
- });
- e.addListener('end', function() {
- d.end();
- });
- d.addListener('data', function(chunk) {
- if (chunk.length > 0)
- console.log('data: ' + chunk);
- });
-
- e.write("Hello world", 'binary');
- e.end();
+ fs.createReadStream(__filename).pipe(e).pipe(d).pipe(process.stdout, {end: false})
+
+EncryptStream/DecryptStream (opts)
+
+`opts` may be a the key (string) or a object. If `opts` is an object it _must_
+have properties for `key` and `algorithm`, and _may_ have properties
+`inputEncoding` and `outputEncoding`
+
+also see [crypto.createCypher][createCypher]
+
+[createCypher]: http://nodejs.org/api/crypto.html#crypto_crypto_createcipher_algorithm_password
Please sign in to comment.
Something went wrong with that request. Please try again.