npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zhigang1992/bundlewatch

v0.0.2

Published

Keep watch of your bundle size

Downloads

5

Readme

npm bundlewatch All Contributors

node deps dev-deps builds test

Inspired by Siddharth Kshetrapal bundlesize

Getting Started:

Install the BundleWatch package:

  • NPM: npm install bundlewatch --save-dev
  • Yarn: yarn add bundlewatch --dev

Add some basic configuration to your package.json

{
    "name": "my package name",
    "version": "0.0.1",
    "bundlewatch" : {
        "files": [
            {
                "path": "myfolder/*.js",
                "maxSize": "100kB"
            }
        ]
    }
}

Usage:

  • NPM: npm run bundlewatch
  • Yarn: yarn run bundlewatch

This will give you command line output. If you want BundleWatch to report build status on your pull requests, see below.

Adding Build Status:

BundleWatch can report its status on your GitHub Pull Requests.

CI Auth Variables Needed by BundleWatch:

  • BUNDLEWATCH_GITHUB_TOKEN

You will need to give BundleWatch access to your GitHub Statuses, which can be done by heading to: https://service.bundlewatch.io/setup-github

This will give you your BUNDLEWATCH_GITHUB_TOKEN. You will need to set this as an environment variable in CI.

CI Variables Needed by BundleWatch:

The most efficient way to get this running is to ensure that some environment variables are available for BundleWatch to find.

  • CI_REPO_OWNER github.com/facebook/react
  • CI_REPO_NAME github.com/facebook/react
  • CI_COMMIT_SHA
  • CI_BRANCH

If you're using, Travis, CircleCI, Wrecker, Drone or GitHub Actions these should all work out of the box.

Have a look at the source code to see which variables are automatically found: https://github.com/bundlewatch/bundlewatch/blob/master/src/app/config/getCIVars.js

Viewing the results breakdown

After setting up the above you will have BuildStatus on your Pull Requests. Clicking the details link on the reported status will show you a results file breakdown.

Additional Documentation:

Full documentation avialable on bundlewatch.io

I use bundlesize, why should I switch to BundleWatch?

  • Bundlesize has entered maintenance mode and pull requests are left hanging, so we wanted to reboot the community through creating BundleWatch
  • New BundleWatch service with infrastructure as code
  • Launched bundlewatch.io documentation website
  • Enough test coverage to support CD
  • Node API Support
  • Lower barrier to contributing (automated testing and publishing), build a trusted community of contributors to have continuous improvement

Additional Features:

  • [x] Config validation to stop users from guessing why BundleWatch won't work
  • [x] Support for config file path
  • [x] Better results breakdown page
  • [x] Better comparisons between branches, support branches other than master
  • [x] Support for your own server for storing data
  • [x] New and improved CI behaviour
  • [ ] Show history of BundleWatchs over time (coming soon)

Contributors

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Want to Help? Become a Contributor

Contributions of any kind are welcome! See the Contributing docs or Join us on Slack and start contributing.