check-deps-versions
Advanced tools
Comparing version 0.1.1 to 0.2.0
22
index.js
@@ -0,4 +1,5 @@ | ||
const path = require('path'); | ||
const chalk = require('chalk'); | ||
const findNearestFile = require('find-nearest-file'); | ||
const packageJsonPath = findNearestFile('package.json'); | ||
const minimist = require('minimist'); | ||
const fileExists = require('file-exists'); | ||
@@ -14,2 +15,19 @@ const error = message => { | ||
const specifiedPackageJsonLocation = minimist(process.argv).p; | ||
let packageJsonPath; | ||
if (specifiedPackageJsonLocation) { | ||
packageJsonPath = path.resolve(specifiedPackageJsonLocation, 'package.json'); | ||
} else { | ||
const findNearestFile = require('find-nearest-file'); | ||
packageJsonPath = findNearestFile('package.json'); | ||
} | ||
if (!fileExists(packageJsonPath)) { | ||
errorAndExit(`${packageJsonPath} doesn't exist`); | ||
} | ||
console.log(chalk.magenta(`Analyzing ${path.relative(__dirname, packageJsonPath)}`)); // eslint-disable-line no-console | ||
if (packageJsonPath === null) { | ||
@@ -16,0 +34,0 @@ errorAndExit('Couldn\'t find package.json'); |
{ | ||
"name": "check-deps-versions", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Check if dependencies specified in package.json are up to date with the latest available versions.", | ||
@@ -21,4 +21,6 @@ "repository": { | ||
"chalk": "^1.1.3", | ||
"file-exists": "^2.0.0", | ||
"find-nearest-file": "^1.0.0", | ||
"lodash.sortby": "^4.7.0", | ||
"minimist": "^1.2.0", | ||
"package-json": "^2.4.0", | ||
@@ -25,0 +27,0 @@ "semver": "^5.3.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6861
133
9
+ Addedfile-exists@^2.0.0
+ Addedminimist@^1.2.0
+ Addedfile-exists@2.0.0(transitive)