The crypto module of node.js (at the time of this writing at least) is not still deemed stable and so the API may change. In fact, the methods that everyone in the internet
Short version of Carlos' answer:
var fs = require('fs') var crypto = require('crypto') fs.createReadStream('/some/file/name.txt'). pipe(crypto.createHash('sha1').setEncoding('hex')). on('finish', function () { console.log(this.read()) //the hash })