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

sizer-soze

v0.1.0

Published

Node version of the wonderful Sizer-Soze project

Downloads

5

Readme

sizer-soze

Node version of the wonderful Sizer-Soze project

What is the cost of your non-responsive images?

We've been talking about responsive images for years now, but what is the actual cost of delivering non-responsive images to narrow viewports? How many bytes are we sending for nothing?

@grigs wrote a blog post on responsive images breakpoints and their relation to a site's performance budget, which got me thinking: "We cannot manage a budget if we cannot measure costs".

So, I wrote this small script that measures a certain site in multiple viewports and outputs the bytes we can optimize losslessly and the bytes we can optimize if we'd tailor the images to this specific viewport.

Getting Started

Install the module with: npm install sizer-soze

var soze = require( './sizer-soze' );

soze.sizer( url, function( err, data ){
  if( err ){ throw err; }
  console.log( data );
});

Results

Besides the summary results printed to screen, you can see detailed per-image results in your /tmp/ directory. Each tested site creates a directory there, and the original, optimized and resized images are stored there, as well as result logs per viewport.

Dependencies

  • image_optim
  • ImageMagick
  • curl
  • PhantomJS

How it works

  • run.sh simply iterates over 2 other scripts with several viewport sizes. Adding more viewports is simple, but it slows down the running time.
  • getImageDimensions.js is a phantomjs script that downloads the requested URL, and outputs all of its content images as well as their dimensions.
  • getResizedBenefits.sh is a bash script that gets the results of getImageDimensions.js, downloads the original images and resizes these images to see what their resized size is. It also optimizes the original images using image_optim, to see how much lossless optimization can get us.

Why bash???

I was aiming to minimize dependencies, so I went with bash. And well, now it's wrapped in Node.

What's with the name????

It's Saturday.

Documentation

(Coming soon)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

License

Copyright (c) 2013 Jeffrey Lembeck & Yoav Weiss
Licensed under the MIT license.