Package detail

depcost

rich-lab69MIT0.4.2

Retrieve the time and space cost of using a dependency

dependency

readme

depcost

NPM version NPM downloads Node.js CI codecov

logo
e.g. retrieve the time & space cost of latest 5 versions of fs-extra.

Introduction

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.

Features

  • With Require time, you will know if the dependency you are using now is likely to slow down your node application.
  • With Install size of a dependency, you will know if the dependency is too cumbersome and wastes your disk.
  • Quickly specify the latest released versions.

Install

npm install depcost -g

Usage

Using depcost or its shortcut dc:

Usage:
  $ depcost [...pkgs]

For more info, run any command with the `--help` flag:
  $ depcost --help

Options:
  -t, --track                             Whether to keep temp directory.
  -r, --latest-versions <latestVersions>  Specify the count of latest versions.
  -s, --versions <versions>               Select specific versions.
  -l, --log-level <logLevel>              log level of npmlog under the hood.
  -n, --npm-client <npmClient>            set npm client, defaults to npm.
  -d, --debug                             Shortcut to set log level to "debug".
  -h, --help                              Display this message
  -v, --version                           Display version number

Examples:

depcost [package]
depcost [package] --log-level=info
depcost [package] --debug
depcost [package@version]
depcost [package1] [package2] [package3]
depcost [package] --latest-versions=3
depcost [package] --versions=1.0.0,2.0.0

Global Config

You can set global options at ~/.depcostrc with ini syntax.

e.g., set npmClient to tnpm globally:

echo 'npmClient=tnpm' > ~/.depcostrc

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

depcost © ULIVZ under Richlab Team, Released under the MIT License.

changelog

0.4.2 (2020-07-13)

Bug Fixes

Features

  • --table flag - allow to log as markdown table. (d2b6a63)
  • reverse insert position - from end to beginning. (#1) (77c95b6)
  • support yarn as npmClient (4f6cbf9)
  • $core: expose bootstrap api. (e2164fd)
  • $core: return raw bytes size number (473d3d1)
  • $core: support --dependencies--dev-dependencies--all-dependencies options (ab0fa46)

Performance Improvements

  • avoid bind listeners for process by many times. (8f23af9)

0.4.1 (2020-07-10)

Features

  • $core: return raw bytes size number (473d3d1)

0.4.0 (2020-07-10)

Features

  • $core: support --dependencies--dev-dependencies--all-dependencies options (ab0fa46)

0.3.0 (2020-07-10)

Features

  • $core: expose bootstrap api. (e2164fd)

0.2.2 (2020-03-22)

Performance Improvements

  • avoid bind listeners for process by many times. (8f23af9)

0.2.1 (2020-03-13)

Bug Fixes

Features

  • support yarn as npmClient (4f6cbf9)

0.2.0 (2020-03-13)

Features

  • --table flag - allow to log as markdown table. (d2b6a63)
  • reverse insert position - from end to beginning. (#1) (77c95b6)

0.1.10 (2020-03-08)

Bug Fixes

0.1.10 (2020-03-08)

Bug Fixes

0.1.9 (2020-03-08)

Features

  • generate extra title for monorepo. (faa3e96)

0.1.8 (2020-03-08)

Features

0.1.7 (2020-03-08)

Features

  • --cwd option and defaults to current package at cwd. (2c201f8)
  • support --record flag (73aa773)

0.1.6 (2020-03-08)

Bug Fixes

  • regression of renaming files. (d7b70a7)

0.1.5 (2020-03-08)

Bug Fixes

0.1.4 (2020-03-08)

Bug Fixes

0.1.3 (2020-03-03)

Bug Fixes

  • conflict of shortcut for cli flags (-s, --versions / -n, --npm-client) (15a15a6)

0.1.2 (2020-03-03)

Features

  • support get require time of a local path. (399e495)

0.1.1 (2020-03-02)

Features

  • rename 'dep-cost' tp 'depcost' (b63933e)

0.1.0 (2020-03-02)

Bug Fixes

  • issue of parsePackageName & improve test. (ad6792c)

Features