1 | # deps-ok
|
2 |
|
3 | Fast checking of top level NPM and Bower dependencies based on version numbers.
|
4 |
|
5 | [![NPM info][nodei.co]](https://npmjs.org/package/deps-ok)
|
6 |
|
7 | [![Build status][ci-image]][ci-url]
|
8 | [![dependencies][dependencies-image]][dependencies-url]
|
9 | [![devdependencies][deps-ok-devdependencies-image] ][deps-ok-devdependencies-url]
|
10 | [![manpm](https://img.shields.io/badge/manpm-%E2%9C%93-3399ff.svg)](https://github.com/bahmutov/manpm)
|
11 | [![semantic-release][semantic-image] ][semantic-url]
|
12 | [![renovate-app badge][renovate-badge]][renovate-app]
|
13 |
|
14 | See [grunt-deps-ok](https://github.com/bahmutov/grunt-deps-ok) for
|
15 | integrating this task into grunt pipeline.
|
16 |
|
17 | ## Install
|
18 |
|
19 | Install as a global tool
|
20 |
|
21 | npm install -g deps-ok
|
22 |
|
23 | Install as a project's dependency
|
24 |
|
25 | npm install --save-dev deps-ok
|
26 |
|
27 | ## Use as a global tool
|
28 |
|
29 | Checks modules until the first module without valid install.
|
30 | Prints first found error and exits with code 1 if one of the
|
31 | top level dependencies is missing or out of date.
|
32 |
|
33 | // from the package's root folder execute
|
34 | deps-ok
|
35 |
|
36 | deps-ok --verbose
|
37 | // prints declared and installed version numbers
|
38 |
|
39 | deps-ok --filename path/to/package.json
|
40 | // checks give package.json (not in this folder)
|
41 |
|
42 | Checks both dependencies listed in your *package.json* and *bower.json*
|
43 |
|
44 | If **deps-ok** finds a problem, then run `npm install` or `bower install`
|
45 |
|
46 | ## Use as 3<sup>rd</sup> party module
|
47 |
|
48 | You can use **deps-ok** from another module
|
49 |
|
50 | ```javascript
|
51 | npm install deps-ok --save
|
52 | var depsOk = require('deps-ok');
|
53 | var ok = depsOk(process.cwd(), false /* verbose */);
|
54 | ```
|
55 |
|
56 | ## Use with gulp
|
57 |
|
58 | If you prefer using [gulp](), you can quickly just add a task
|
59 |
|
60 | ```js
|
61 | gulp.task('deps-ok', function () {
|
62 | var gutil = require('gulp-util');
|
63 | var depsOk = require('deps-ok');
|
64 | var ok = depsOk(process.cwd(), false /* verbose */);
|
65 | if (!ok) {
|
66 | gulp.emit('error', new gutil.PluginError('deps-ok', 'Found outdated installs'));
|
67 | }
|
68 | });
|
69 | gulp.task('default', ['deps-ok', ...]);
|
70 | ```
|
71 |
|
72 | ## Options
|
73 |
|
74 | * `--allow-duplicate <name>` allows same dependency to be declared in dev and peer dependencies (or other combinations). Useful if you are developing a plugin that requires the main tool (peer) but also uses the main tool for testing (dev).
|
75 |
|
76 | ```
|
77 | $ deps-ok --allow-duplicate angular
|
78 | $ deps-ok --allow-duplicate angular --allow-duplicate jquery
|
79 | ```
|
80 |
|
81 | * `--verbose` prints verbose console messages, but using `DEBUG=deps-ok` is a better method
|
82 |
|
83 | * `--skip-version-check` is used to load and check versions but skip actual physical file checks. Useful in end to end testing.
|
84 |
|
85 | ## Notes
|
86 |
|
87 | This check will reject packages without "version" property in the `package.json`
|
88 | file.
|
89 |
|
90 | ## Debug
|
91 |
|
92 | See debug messages by running module with `DEBUG=deps-ok` environment variable
|
93 |
|
94 | ## Small print
|
95 |
|
96 | Author: Gleb Bahmutov © 2013
|
97 |
|
98 | * [@bahmutov](https://twitter.com/bahmutov)
|
99 | * [glebbahmutov.com](http://glebbahmutov.com)
|
100 | * [blog](http://glebbahmutov.com/blog/)
|
101 |
|
102 | License: MIT - do anything with the code, but don't blame me if it does not work.
|
103 |
|
104 | Support: if you find any problems with this module, email / tweet / open issue on Github
|
105 |
|
106 | [ci-image]: https://travis-ci.org/bahmutov/deps-ok.svg?branch=master
|
107 | [ci-url]: https://travis-ci.org/bahmutov/deps-ok
|
108 | [nodei.co]: https://nodei.co/npm/deps-ok.svg?downloads=true
|
109 | [dependencies-image]: https://david-dm.org/bahmutov/deps-ok.svg
|
110 | [dependencies-url]: https://david-dm.org/bahmutov/deps-ok
|
111 | [deps-ok-devdependencies-image]: https://david-dm.org/bahmutov/deps-ok/dev-status.svg
|
112 | [deps-ok-devdependencies-url]: https://david-dm.org/bahmutov/deps-ok#info=devDependencies
|
113 | [endorse-image]: https://api.coderwall.com/bahmutov/endorsecount.svg
|
114 | [endorse-url]: https://coderwall.com/bahmutov
|
115 | [semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
|
116 | [semantic-url]: https://github.com/semantic-release/semantic-release
|
117 | [renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg
|
118 | [renovate-app]: https://renovateapp.com/
|