diff --git a/bin/json2csv.js b/bin/json2csv.js index 03236cbd..c2472730 100755 --- a/bin/json2csv.js +++ b/bin/json2csv.js @@ -3,6 +3,7 @@ var fs = require('fs'); var os = require('os'); var path = require('path'); +var isAbsolutePath = require('path-is-absolute'); var Table = require('cli-table'); var program = require('commander'); var debug = require('debug')('json2csv:cli'); @@ -49,7 +50,7 @@ function getInput(callback) { var input, isAbsolute, rows; if (program.input) { - isAbsolute = path.isAbsolute(program.input); + isAbsolute = isAbsolutePath(program.input); input = require(isAbsolute ? program.input : path.join(process.cwd(), program.input)); return callback(null, input); diff --git a/package.json b/package.json index 07749ac7..f534da61 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,12 @@ "test": "eslint . && node test | tap-spec", "test-coverage": "istanbul cover test/index.js --report lcovonly | tap-spec" }, - "engines": { - "node": ">=0.12" - }, "dependencies": { "cli-table": "^0.3.1", "commander": "^2.8.1", "debug": "^2.2.0", - "lodash.get": "^3.7.0" + "lodash.get": "^3.7.0", + "path-is-absolute": "^1.0.0" }, "devDependencies": { "async": "^1.4.2",