Skip to content

Commit

Permalink
Removed unnecessary dep
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jun 28, 2016
1 parent 0ccec1b commit f6e6d63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 3 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
'use strict'

var fs = require('graceful-fs')
var path = require('path')

function getAbsolutePath (filepath) {
return path.resolve(process.cwd(), filepath)
}
var fs = require('fs')

function isString (str) {
return typeof str === 'string'
Expand All @@ -17,7 +12,7 @@ function existeFile (filepath, cb) {
cb = cb || noop
if (!isString(filepath)) return cb(null, false)

fs.stat(getAbsolutePath(filepath), function (err, stats) {
fs.stat(filepath, function (err, stats) {
if (!err) return cb(null, true)
if (err.code === 'ENOENT') return cb(null, false)
return cb(err, stats)
Expand All @@ -27,7 +22,7 @@ function existeFile (filepath, cb) {
existeFile.sync = function existeFileSync (filepath) {
if (!isString(filepath)) return false
try {
fs.statSync(getAbsolutePath(filepath))
fs.statSync(filepath)
return true
} catch (err) {
if (err.code === 'ENOENT') return false
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
"exists",
"file",
"file system",
"filesystem",
"fs",
"recursive"
],
"dependencies": {
"graceful-fs": "~4.1.4"
},
"devDependencies": {
"coveralls": "latest",
"mocha": "latest",
Expand Down

0 comments on commit f6e6d63

Please sign in to comment.