Skip to content

Commit

Permalink
Split CLI to separate file
Browse files Browse the repository at this point in the history
LinusU committed Sep 10, 2017
1 parent 27a5f60 commit 2e59275
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 7 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node

'use strict'

const md5File = require('./')

console.log(md5File.sync(process.argv[2]))
5 changes: 0 additions & 5 deletions index.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env node
'use strict'

var crypto = require('crypto')
@@ -43,9 +42,5 @@ function md5File (filename, cb) {
input.pipe(output)
}

if (require.main === module) {
console.log(md5FileSync(process.argv[2]))
}

module.exports = md5File
module.exports.sync = md5FileSync
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
"main": "index.js",
"repository": "roryrjb/md5-file",
"files": [
"cli.js",
"index.js",
"promise.js"
],
@@ -21,7 +22,7 @@
"scripts": {
"test": "standard && mocha"
},
"bin": "index.js",
"bin": "cli.js",
"devDependencies": {
"mocha": "^2.4.5",
"standard": "^7.1.0"

0 comments on commit 2e59275

Please sign in to comment.