Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a depsDir option which allows for checking nested dependencies #8

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ Type: `string`

Default: the closest directory containing `package.json` or `bower.json` (depending on `packageManager` specified) when going up the tree, starting from the current one

### depsDir

Path to the directory containing `node_modules` or `bower_components`.

Type: `string`

Default: `undefined`. By default, check-dependencies will use the `packageDir` option.

### onlySpecified

Ensures all installed dependencies are specified in `package.json` or `bower.json`.
Expand Down Expand Up @@ -125,6 +133,22 @@ Type: `boolean`

Default: `false`

### checkGitUrls

By default, check-dependencies will skip version check for packages whose version contains the full repository path. For example:

```js
"dependencies": {
"semver": "https://github.com/npm/node-semver.git#0.5.9"
}
```

If checkGitUrls is enabled, check-dependencies will parse the version number (after the path to the git repository and the hash) and check it against the version of the installed package.

Type: `boolean`

Default: `false`

### verbose

Prints messages to the console.
Expand Down
2 changes: 1 addition & 1 deletion lib/check-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function checkDependenciesHelper(syncOrAsync, config, callback) {
pkgManagerPath = findup('node_modules/bower/bin/bower');
}

depsDir = options.packageDir + '/' + depsDirName;
depsDir = (options.depsDir || options.packageDir) + '/' + depsDirName;

// Make sure each package from `scopeList` is present and matches the specified version range.
// Packages from `optionalScopeList` may not be present but if they are, they are required
Expand Down