Skip to content

Commit

Permalink
Fix readme example (#245)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <[email protected]>
  • Loading branch information
midnightcodr and sindresorhus committed Sep 15, 2019
1 parent 6ed5344 commit 2f69644
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ const fileType = require('file-type');
const read = fs.createReadStream('encrypted.enc');
const decipher = crypto.createDecipheriv(alg, key, iv);

const stream = await fileType.stream(stream.pipeline(read, decipher));
const fileTypeStream = await fileType.stream(stream.pipeline(read, decipher));

console.log(stream.fileType);
console.log(fileTypeStream.fileType);
//=> {ext: 'mov', mime: 'video/quicktime'}

const write = fs.createWriteStream(`decrypted.${stream.fileType.ext}`);
stream.pipe(write);
const write = fs.createWriteStream(`decrypted.${fileTypeStream.fileType.ext}`);
fileTypeStream.pipe(write);
})();
```

Expand Down

0 comments on commit 2f69644

Please sign in to comment.