UNPKG

2.81 kBMarkdownView Raw
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
23tnpm install depcost -g
24```
25
26## Usage
27
28Using `depcost` or its shortcut `dc`:
29
30```bash
31Usage:
32 $ depcost [...pkgs]
33
34For more info, run any command with the `--help` flag:
35 $ depcost --help
36
37Options:
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
48Examples:
49
50```bash
51depcost [package]
52depcost [package] --log-level=info
53depcost [package] --debug
54depcost [package@version]
55depcost [package1] [package2] [package3]
56depcost [package] --latest-versions=3
57depcost [package] --versions=1.0.0,2.0.0
58```
59
60## Global Config
61
62You can set global options at `~/.depcostrc` with ini syntax.
63
64e.g., set npmClient to `tnpm` globally:
65
66```bash
67echo 'npmClient=tnpm' > ~/.depcostrc
68```
69
70## Contributing
71
721. Fork it!
732. Create your feature branch: `git checkout -b my-new-feature`
743. Commit your changes: `git commit -am 'Add some feature'`
754. Push to the branch: `git push origin my-new-feature`
765. 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