Giter Site home page Giter Site logo

swipswaps / packagephobia Goto Github PK

View Code? Open in Web Editor NEW

This project forked from styfle/packagephobia

0.0 3.0 0.0 543 KB

⚖️ Find the cost of adding a new dependency to your project

Home Page: https://packagephobia.now.sh

License: MIT License

Dockerfile 0.82% TypeScript 99.18%

packagephobia's Introduction

Package Phobia

dependency devDependency lgtm travis code style: prettier

  • ⚖️ Find the cost of adding a new dev dependency to your project
  • 🕗 Save yourself time and disk space with this web app
  • 📈 Detect javascript bloat over time with a chart
  • 🛡️ Get a badge/shield for your README
  • 📡 Fetch size from json API to integrate into any tool

...as seen on npm weekly and ponyfoo weekly and habr and rwpod and wolf report and all over twitter

What is the purpose?

Package Phobia reports the size of an npm package before you install it.

This is useful for inspecting potential devDependencies without using up precious disk space or waiting minutes for npm install. Ain't nobody got time for dat.

Results are saved so the first person might wait a bit to view package size, but everyone else gets to see the results instantly!

A good use case might be comparing test runners, web frameworks, or even bundlers. Click one of the links below to see Package Phobia in action!

Prior Art

Package Phobia is inspired by Bundle Phobia and Cost Of Modules.

How is this different?

  • Package Phobia reports the install size of a package.
  • Bundle Phobia reports the size after webpack bundles the package.
  • Cost Of Modules reports the size of your currently installed packages.
  • Badge Size reports the gzip size of a single file from a package.
  • Bundle Size fails CI if a file's size is too large.
  • Package Size compares the bundle size of multiple packages.
  • Size Limit compares the bundled (or non-bundled size) of of your package.
  • Require So Slow traces the time of each require module in a node.js app.
  • Why Bundled? uses webpack stats to show your number of imports and package size.
  • Do you even lift? - NEW reports size after rollup bundles the package.

Why is the size different than size on disk?

Did you install a package and compare the size on disk with the size reported on Package Phobia?

This number will likely be different because Package Phobia doesn't know anything about your hard drive so it can't predict how blocks are allocated.

Packages are known to contain many small .js files which can actually use up a lot of disk space, more than if there was one large, contiguous file.

See StackOverflow for more details.

What are the long term goals?

Ideally, this information could be listed on npmjs.com, npms.io, or bundlephobia.com.

Below are the relevant feature requests for each website.

Hopefully, this would lead to publishers taking notice of their bloated packages such as the following:

npm dependencies in the media

I'm not the first one to notice npm packages are snowballing into bloated dependencies of dependencies.

Below are some other users who comically point out this JS bloat.

Contributing

See CONTRIBUTING.md and CODE_OF_CONDUCT.md before you start writing any code

Author

Developed by ceriously.com

packagephobia's People

Contributors

styfle avatar dependabot-support avatar danielruf avatar jorgebucaran avatar

Watchers

James Cloos avatar #swipswaps avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.