All Projects → AdrieanKhisbe → Bundle Phobia Cli

AdrieanKhisbe / Bundle Phobia Cli

Licence: mit
📦 Cli for the node BundlePhobia Service 😱

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Bundle Phobia Cli

Npkill
List any node_modules directories in your system, as well as the space they take up. You can then select which ones you want to erase to free up space.
Stars: ✭ 5,325 (+4830.56%)
Mutual labels:  cli, hacktoberfest, npm
Dependency spy
Find known vulnerabilities in your dependencies
Stars: ✭ 87 (-19.44%)
Mutual labels:  hacktoberfest, npm
Gomplate
A flexible commandline tool for template rendering. Supports lots of local and remote datasources.
Stars: ✭ 1,270 (+1075.93%)
Mutual labels:  cli, hacktoberfest
Tasklite
The CLI task manager for power users
Stars: ✭ 91 (-15.74%)
Mutual labels:  cli, hacktoberfest
Awesome Laravel Zero
👋 START HERE! A curated list of Laravel Zero libraries, resources and projects
Stars: ✭ 84 (-22.22%)
Mutual labels:  cli, hacktoberfest
Redrun
✨🐌 🐎✨ fastest npm scripts runner
Stars: ✭ 85 (-21.3%)
Mutual labels:  cli, npm
Rymfony
A work-in-progress CLI tool built in Rust to mimic the Symfony CLI binary
Stars: ✭ 89 (-17.59%)
Mutual labels:  cli, hacktoberfest
Navi
An interactive cheatsheet tool for the command-line
Stars: ✭ 10,055 (+9210.19%)
Mutual labels:  cli, hacktoberfest
Texture Synthesis
🎨 Example-based texture synthesis written in Rust 🦀
Stars: ✭ 1,337 (+1137.96%)
Mutual labels:  cli, hacktoberfest
Meteor
Meteor, the JavaScript App Platform
Stars: ✭ 42,739 (+39473.15%)
Mutual labels:  hacktoberfest, npm
Cryptocurrency Cli
💰 Cryptocurrency Portfolio On The Command Line 💰
Stars: ✭ 99 (-8.33%)
Mutual labels:  cli, npm
Ritchie Formulas
This repository contains the community formulas that can be executed through Ritchie CLI once imported. This tool is an open source product that allows you to create, store and share any kind of automations, executing them through command lines, to run operations or start workflows ⚙️ 🖥 💡
Stars: ✭ 84 (-22.22%)
Mutual labels:  cli, hacktoberfest
Xa
Beautiful & Customizable logger ❤️
Stars: ✭ 78 (-27.78%)
Mutual labels:  cli, npm
Pypistats
Command-line interface to PyPI Stats API to get download stats for Python packages
Stars: ✭ 86 (-20.37%)
Mutual labels:  cli, hacktoberfest
Emma Cli
📦 Terminal assistant to find and install node packages.
Stars: ✭ 1,201 (+1012.04%)
Mutual labels:  cli, npm
Nps
NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
Stars: ✭ 1,285 (+1089.81%)
Mutual labels:  cli, npm
Npm Try
🚆 Quickly try npm packages without writing boilerplate code.
Stars: ✭ 103 (-4.63%)
Mutual labels:  cli, npm
Listr2
NodeJS Task List derived from the best! Create beautiful CLI interfaces via easy and logical to implement task lists that feel alive and interactive.
Stars: ✭ 73 (-32.41%)
Mutual labels:  cli, npm
Mockingcase
node package that converts a string to mOcKiNgCaSe
Stars: ✭ 74 (-31.48%)
Mutual labels:  hacktoberfest, npm
Generator Ngx Rocket
🚀 Extensible Angular 11+ enterprise-grade project generator
Stars: ✭ 1,329 (+1130.56%)
Mutual labels:  cli, hacktoberfest

bundle-phobia-cli

npm Build Status codecov License: MIT

Cli for the node BundlePhobia Service

About

BundlePhobia is a tool to help you find the cost of adding a npm package to your bundle. It enables you to query package sizes.

Installation

Just use npm install -g bundle-phobia-cli and you're good to go!

Usage

Once installed you will have access to different executables:

  • bundle-phobia: to query package size. Just invoke it with a list of package names and some options.
  • bundle-phobia-install: to conditionally install package if weight constraint are respected. This is a wrapper on npm install

Note that you can specify a version along with the package range such as an instance exact version [email protected] or range version [email protected]^3.0.0.

Examples

# Query package size of lodash and react
$ bundle-phobia lodash react
ℹ lodash (4.17.11) has 0 dependencies for a weight of 68.51KB (24.05KB gzipped)
ℹ react (16.6.0) has 4 dependencies for a weight of 5.86KB (2.48KB gzipped)

# Perform conditional install of lodash
$ bundle-phobia-install lodash
ℹ Applying a size limit of 100KB
ℹ Proceed to installation of package lodash
+ [email protected]
added 1 package from 2 contributors and audited 1 package in 1.377s
found 0 vulnerabilities

Detailed Usage

bundle-phobia

Some option are available to control what stats are outputed by bundle-phobia.

By default an humain friendly output is provided, otherwise you can have a json output with the --json flag. In case you need just the size (or gzip) in a script, you can use the --[gzip]-size flag.

To control the packages to be queried, you can either provide them as an argument list, or you can refer a package.json file with the --package option. This would read the packages as dependencies.

Options Summary
Usage: bundle-phobia <package-name> [other-package-names...]

Options:
  --version           Show version number                              [boolean]
  --package, -p       Provide a package.json to read dependencies       [string]
  --range, -r         Get a range of version (0 for all, 8 by default)  [number]
  --json, -j          Output json rather than a formater string        [boolean]
  --size, -s          Output just the module size                      [boolean]
  --gzip-size, -g     Output just the module gzip size                 [boolean]
  --dependencies, -d  Output just the number of dependencies           [boolean]
  --self              Output bundle-phobia stats                       [boolean]
  -h, --help          Show help                                        [boolean]

bundle-phobia-install

bundle-phobia-install offer three kind of flags:

  • flags to specify the size constraints
  • flags to specify behavior when constraints are not respected
  • npm install flags to control it's behavior

To control the size constraint of a single package: --max-size and --max-gzip-size aliases to -m and -M. To control the overall size of dependencies: --max-overall-size and --max-overall-gzip-size aliases to -o and -O. They expect a size argument that can be either a number or a number followed by a kB, mB unit.

By default if constraint is not respected, install with failed. If you want to perform anyway with just a warning use the --warn/-w flag. If you want to be asked what to do, use the --interactive/-i.

All other options will be conveyed to npm.

Limits can also be configured in the package.json by adding a bundle-phobia section with a max-[gzip-]size key.

{
  "name": "bundle-phobia-install-test",
  "dependencies": {},
  "bundle-phobia": {
    "max-size": "12kB",
    "max-overall-size": "1MB"
  }
}
Options Summary
Usage: bundle-phobia-install <package-name> [other-package-names...]

Options:
  --version            Show version number                             [boolean]
  --warn, -w           Install despite of negative check but warn about
                       predicate violation                             [boolean]
  --interactive, -i    Ask for override in case of predicate violation [boolean]
  --max-size, -m       Size threeshold of individual library to install [string]
  --max-gzip-size, -M  Gzip Size threeshold of individual library to install
                                                                        [string]
  -h, --help           Show help                                       [boolean]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].