sha1-file
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -6,5 +6,6 @@ { | ||
"index.js", | ||
"test.js" | ||
"test.js", | ||
"LICENSE.md" | ||
], | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "return an sha1sum of a given file", | ||
@@ -11,0 +12,0 @@ "keywords": [ |
@@ -1,7 +0,5 @@ | ||
# sha1-file | ||
# sha1-file [![Build Status](https://travis-ci.org/roryrjb/sha1-file.svg?branch=master)](https://travis-ci.org/roryrjb/sha1-file) | ||
### Overview | ||
> Simply return an `sha1` sum of a given file. | ||
Simply return an `sha1` sum of a given file. | ||
### Installation | ||
@@ -53,1 +51,4 @@ | ||
### LICENSE | ||
MIT |
18
test.js
'use strict'; | ||
var sha1 = require('./index'); | ||
var assert = require('assert'); | ||
console.log('sha1 (1) ' + sha1('./README.md')); | ||
assert.equal(sha1('./LICENSE.md'), '635cf3c238455570c909d24a5237050cbb1837e9'); | ||
sha1.async('./README.md', function (data) { | ||
console.log('sha1 (2) ' + data); | ||
sha1.async('./LICENSE.md', function (data) { | ||
assert.equal(data, '635cf3c238455570c909d24a5237050cbb1837e9'); | ||
}); | ||
sha1.async('./README.md', function (data) { | ||
console.log('sha1 (3) ' + data); | ||
sha1.async('./LICENSE.md', function (data) { | ||
assert.equal(data, '635cf3c238455570c909d24a5237050cbb1837e9'); | ||
}, true); | ||
@@ -19,9 +20,4 @@ | ||
sha1.async('./null', function (data) { | ||
console.log('sha1 (4) ' + data); | ||
assert.equal(data.code, 'ENOENT'); | ||
}); | ||
// strict: will throw an error | ||
sha1.async('./null', function (data) { | ||
console.log('sha1 (5) ' + data); | ||
}, true); | ||
4003
54
37