Skip to content

Commit

Permalink
More documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nknapp committed May 7, 2017
1 parent eb4a48f commit 7584946
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .thought/partials/overview.md.hbs
@@ -0,0 +1,10 @@
`{{package.name}}` shows you, why your package is so large. The reason for the size
of your package often lies in the dependencies you are using. For example {{npm 'request'}}@2.81.0`
is 7080kb large (including its 53 dependencies) and it comes with a lot of libraries that you may not even need. If you are aware of that, you may choose to use a different library
(e.g. {{npm 'popsicle'}}).

The module {{npm 'cost-of-modules'}} does the same, but it only shows one level of the
dependency tree. It was an inspiration, but I took no code from it.

Finally, this program still has a lot of opportunities for enhancement. If you have
wishes, ideas or questions, please open an issue.
14 changes: 13 additions & 1 deletion README.md
Expand Up @@ -6,6 +6,16 @@

> Analyze the size of your module dependencies
`analyze-module-size` shows you, why your package is so large. The reason for the size
of your package often lies in the dependencies you are using. For example [request](https://npmjs.com/package/request)@2.81.0`
is 7080kb large (including its 53 dependencies) and it comes with a lot of libraries that you may not even need. If you are aware of that, you may choose to use a different library
(e.g. [popsicle](https://npmjs.com/package/popsicle)).

The module [cost-of-modules](https://npmjs.com/package/cost-of-modules) does the same, but it only shows one level of the
dependency tree. It was an inspiration, but I took no code from it.

Finally, this program still has a lot of opportunities for enhancement. If you have
wishes, ideas or questions, please open an issue.

# Installation

Expand All @@ -19,7 +29,7 @@ Run `analyze-module-size` in your project directory. The output will be somethin
(Note that the displayed sizes are accumulated from the each module an its dependencies):

```
size: 60k... with-dependencies: 1112k
size: 64k... with-dependencies: 1116k
├─┬ globby@6.1.0, 484k, 17 deps
│ ├─┬ glob@7.1.1, 340k, 10 deps
│ │ ├─┬ minimatch@3.0.4, 132k, 3 deps
Expand Down Expand Up @@ -81,6 +91,8 @@ size: 60k... with-dependencies: 1112k
```
Usage: analyze-module-size [options]
Analyzes the size of the package in the current directories, including the size of (production) dependencies
Options:
-h, --help output usage information
Expand Down
2 changes: 2 additions & 0 deletions bin/analyze-module-size.js
Expand Up @@ -7,6 +7,8 @@ require('graceful-fs').gracefulify(require('fs'))

program
.version(require('../package').version)
.description('Analyzes the size of the package in the current directories, ' +
'including the size of (production) dependencies')
.usage('[options]')
.option('-d, --depth <levels>', 'Show only dependencies up to a given depth of recursion')
.parse(process.argv)
Expand Down

0 comments on commit 7584946

Please sign in to comment.