analyze-module-size
Advanced tools
Comparing version 1.2.2 to 1.3.0
#!/usr/bin/env node | ||
var {analyze} = require('../src/index') | ||
const {analyze} = require('../src/index') | ||
const {ProgressHandler} = require('../src/progress') | ||
const program = require('commander') | ||
require('graceful-fs').gracefulify(require('fs')) | ||
var realFs = require('fs') | ||
var gracefulFs = require('graceful-fs') | ||
var {ProgressHandler} = require('../src/progress') | ||
program | ||
.version(require('../package').version) | ||
.usage('[options]') | ||
.option('-d, --depth <levels>', 'Show only dependencies up to a given depth of recursion') | ||
.parse(process.argv) | ||
gracefulFs.gracefulify(realFs) | ||
analyze(process.cwd(), {progress: new ProgressHandler(process.stderr), depth: process.argv[2]}) | ||
analyze(process.cwd(), {progress: new ProgressHandler(process.stderr), depth: program.depth}) | ||
.then( | ||
@@ -13,0 +16,0 @@ (output) => { |
# Release notes for `analyze-module-size` | ||
<a name="current-release"></a> | ||
# Version 1.3.0 (Sun, 07 May 2017 20:05:50 GMT) | ||
* [59b48f4](https://github.com/nknapp/analyze-module-size/commit/59b48f4) Reduce package size by using "p-map" rather than "bluebird" - Nils Knappmeier | ||
* [f820acb](https://github.com/nknapp/analyze-module-size/commit/f820acb) New option "-d, depth <levels>" to cut off the dependency tree display - Nils Knappmeier | ||
# Version 1.2.2 (Sun, 07 May 2017 19:39:45 GMT) | ||
@@ -5,0 +10,0 @@ |
{ | ||
"name": "analyze-module-size", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "Analyze the size of your module dependencies", | ||
@@ -35,4 +35,4 @@ "repository": { | ||
"archy": "^1.0.0", | ||
"bluebird": "^3.5.0", | ||
"chalk": "^1.1.3", | ||
"commander": "^2.9.0", | ||
"debug": "^2.6.6", | ||
@@ -43,2 +43,3 @@ "deep-aplus": "^1.0.4", | ||
"graceful-fs": "^4.1.11", | ||
"p-map": "^1.1.1", | ||
"pify": "^2.3.0", | ||
@@ -45,0 +46,0 @@ "progress": "^2.0.0" |
@@ -22,7 +22,6 @@ # analyze-module-size | ||
``` | ||
size: 60k... with-dependencies: 1720k | ||
├── bluebird@3.5.0, 716k, 0 deps | ||
size: 60k... with-dependencies: 1112k | ||
├─┬ globby@6.1.0, 484k, 17 deps | ||
│ ├─┬ glob@7.1.1, 340k, 10 deps | ||
│ │ ├─┬ minimatch@3.0.3, 132k, 3 deps | ||
│ │ ├─┬ minimatch@3.0.4, 132k, 3 deps | ||
│ │ │ └─┬ brace-expansion@1.1.7, 84k, 2 deps | ||
@@ -47,3 +46,3 @@ │ │ │ ├── concat-map@0.0.1, 40k, 0 deps | ||
├─┬ glob@7.1.1, 340k, 10 deps | ||
│ ├─┬ minimatch@3.0.3, 132k, 3 deps | ||
│ ├─┬ minimatch@3.0.4, 132k, 3 deps | ||
│ │ └─┬ brace-expansion@1.1.7, 84k, 2 deps | ||
@@ -71,2 +70,4 @@ │ │ ├── concat-map@0.0.1, 40k, 0 deps | ||
│ └── ms@0.7.3, 20k, 0 deps | ||
├─┬ commander@2.9.0, 88k, 1 deps | ||
│ └── graceful-readlink@1.0.1, 28k, 0 deps | ||
├── archy@1.0.0, 52k, 0 deps | ||
@@ -77,6 +78,20 @@ ├── graceful-fs@4.1.11, 48k, 0 deps | ||
├── progress@2.0.0, 44k, 0 deps | ||
├── p-map@1.1.1, 20k, 0 deps | ||
└── pify@2.3.0, 20k, 0 deps | ||
``` | ||
## CLI options | ||
``` | ||
Usage: analyze-module-size [options] | ||
Options: | ||
-h, --help output usage information | ||
-V, --version output the version number | ||
-d, --depth <levels> Show only dependencies up to a given depth of recursion | ||
``` | ||
# License | ||
@@ -83,0 +98,0 @@ |
const path = require('path') | ||
const {findPackages} = require('./find-packages') | ||
var {Package} = require('./Package') | ||
var Promise = require('bluebird') | ||
var pmap = require('p-map') | ||
const deep = require('deep-aplus')(Promise) | ||
@@ -49,3 +49,3 @@ const {NullProgressHandler} = require('./progress') | ||
// but the progress bar behaves much more consistent. | ||
return Promise.map( | ||
return pmap( | ||
dependencies, | ||
@@ -52,0 +52,0 @@ (packageJson) => { |
24576
500
106
11
+ Addedcommander@^2.9.0
+ Addedp-map@^1.1.1
+ Addedcommander@2.20.3(transitive)
+ Addedp-map@1.2.0(transitive)
- Removedbluebird@^3.5.0
- Removedbluebird@3.7.2(transitive)