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

mister-gold-cdn

v2.1.4

Published

Static resources from 'Mister Gold' blog: https://mister-gold.pro

Downloads

10

Readme

mister-gold-cdn

Static resources (css, js, etc.) from Mister Gold blog.

mister-gold-cdn npm mister-gold-cdn Downloads

NPM

Introduction

The idea of having a detached location (a repository) with static files is based on separating requests when loading a website. In other words, it is better to have 5 different places for loading resources from, rather than just one place that holds all the resources.

When there is only one place that holds all the resources, the requests go consecutively in queue, which means that it is impossible to load a specific resource, until all the preceding requests are loaded. When there are multiple locations, the requests can go in parallel, without blocking each other, which reduces the time taken to load the whole site. As research show, the average load time can be reduced up to 30-50%.

Solution

This solution uses GitHub repository to store the static files that are published as a npm package and then distributed via jsDelivr Content Delivery Network. The links to the distributed files are added to the template files of my blog, where they are actually called from. To make the CDN even more efficient and decrease the number of concurrent requests, all non-critical files were combined into one. Furthermore, I used subsetting for resources like FontAwesome to get rid of excessive (and unused) portions of code.

Results

These results were received on my personal blog that is powered by Pelican Static Site Generator and hosted on GitLab Pages.

Parameter | Before | After | Profit :------------------|:---------:|:---------------------------------:|:-----:| number of requests | 12 | 9 (can be further decreased to 7) | 25% | load time | 1.66 s | 366 ms | 78% | page size | 143.3 Kb | 88.8 Kb | 38% | performance grade | 86 | 92 | 7% |

I assume that the same (or even greater) results can be acheived on other SSG (e.g. Jekyll, Hugo or Hexo) or CMS (e.g. WordPress), because there are bunch of files that can be easily combined and distributed over a CDN.

Contribution

The implemetation of my "static network" is stupidly simple and I suppose it is not as great as it could be, so if there are some better, more efficient or elegant approaches, your ideas are welcome and appreciated! Feel free to create an issue and share your thoughts. Let's do some cool stuff together!