1 | # depcost
|
2 |
|
3 | [![NPM version](https://img.shields.io/npm/v/depcost.svg?style=flat)](https://npmjs.com/package/depcost) [![NPM downloads](https://img.shields.io/npm/dm/depcost.svg?style=flat)](https://npmjs.com/package/depcost) ![Node.js CI](https://github.com/rich-lab/depcost/workflows/Node.js%20CI/badge.svg) [![codecov](https://codecov.io/gh/rich-lab/depcost/branch/master/graph/badge.svg)](https://codecov.io/gh/rich-lab/depcost)
|
4 |
|
5 | <p align="center">
|
6 | <img width="600" src="https://github.com/rich-lab/depcost/blob/master/assets/example.png?raw=true" alt="logo"><br />
|
7 | <small><i>e.g. retrieve the time & space cost of latest 5 versions of <code>fs-extra</code>.</i></small>
|
8 | </p>
|
9 |
|
10 | ## Introduction
|
11 |
|
12 | **depcost** (abbr. **dc**) is a cli tool for you to judge whether a node module deserve your favor via knowing the time and space cost of a dependency.
|
13 |
|
14 | ## Features
|
15 |
|
16 | - With **Require time**, you will know if the dependency you are using now is likely to **slow down** your node application.
|
17 | - With **Install size** of a dependency, you will know if the dependency is too cumbersome and **wastes your disk.**
|
18 | - Quickly specify the latest released versions.
|
19 |
|
20 | ## Install
|
21 |
|
22 | ```bash
|
23 | tnpm install depcost -g
|
24 | ```
|
25 |
|
26 | ## Usage
|
27 |
|
28 | Using `depcost` or its shortcut `dc`:
|
29 |
|
30 | ```bash
|
31 | Usage:
|
32 | $ depcost [...pkgs]
|
33 |
|
34 | For more info, run any command with the `--help` flag:
|
35 | $ depcost --help
|
36 |
|
37 | Options:
|
38 | -t, --track Whether to keep temp directory.
|
39 | -r, --latest-versions <latestVersions> Specify the count of latest versions.
|
40 | -s, --versions <versions> Select specific versions.
|
41 | -l, --log-level <logLevel> log level of npmlog under the hood.
|
42 | -n, --npm-client <npmClient> set npm client, defaults to npm.
|
43 | -d, --debug Shortcut to set log level to "debug".
|
44 | -h, --help Display this message
|
45 | -v, --version Display version number
|
46 | ```
|
47 |
|
48 | Examples:
|
49 |
|
50 | ```bash
|
51 | depcost [package]
|
52 | depcost [package] --log-level=info
|
53 | depcost [package] --debug
|
54 | depcost [package@version]
|
55 | depcost [package1] [package2] [package3]
|
56 | depcost [package] --latest-versions=3
|
57 | depcost [package] --versions=1.0.0,2.0.0
|
58 | ```
|
59 |
|
60 | ## Global Config
|
61 |
|
62 | You can set global options at `~/.depcostrc` with ini syntax.
|
63 |
|
64 | e.g., set npmClient to `tnpm` globally:
|
65 |
|
66 | ```bash
|
67 | echo 'npmClient=tnpm' > ~/.depcostrc
|
68 | ```
|
69 |
|
70 | ## Contributing
|
71 |
|
72 | 1. Fork it!
|
73 | 2. Create your feature branch: `git checkout -b my-new-feature`
|
74 | 3. Commit your changes: `git commit -am 'Add some feature'`
|
75 | 4. Push to the branch: `git push origin my-new-feature`
|
76 | 5. Submit a pull request :D
|
77 |
|
78 | ## Author
|
79 |
|
80 | **depcost** © [ULIVZ](https://github.com/ulivz) under [Richlab Team](https://www.yuque.com/richlab/join-us/invitation), Released under the [MIT](./LICENSE) License.<br>
|
81 |
|
82 |
|
83 |
|