Giter Club home page Giter Club logo

badge-size's Introduction

badge-size's People

Contributors

bfred-it avatar clshortfuse avatar dependabot[bot] avatar fezvrasta avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hairmot avatar nathancahill avatar ngryman avatar oliverjash avatar styfle avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

badge-size's Issues

QUESTION: gzip size calculation

Hi, I wonder how does it calculate the size when you point out only one index.js file?

For example, I have 4 files in repo/master/lib/

a.js //300b
b.js //800b
c.js //400b

index.js // 1b
//index.js
'use strict';
...
var _a = require('./a.js');
var _b = require('./b.js');
var _c = require('./c.js');
...

and the result of http://img.badgesize.io/dummy/repo/master/lib/index.js.svg?compression=gzip will most likely be 1b instead of total 300 + 800 + 400 + 1.

Am I understand it correctly?

Feature Request: Accept the bundle size as a parameter

I would love to use this badge service for modules on our internal Github Enterprise. This would obviously mean that the badge service can't pull the file to check the size automatically. However, if the file-size were an optional parameter, then we could still use the service.

We have an npm-script that checks file size of the dist files after a build. We could write this info directly into the README itself as part of the badge URL.

Strip sourcemap comment before calculating size?

Hi there!

Most people bundle their libraries using tools like Webpack, Parcel or Rollup. All of these remove sourcemap comments as part of the build process, meaning users of a library don't generally "pay" for sourcemap comments. For this reason, I've generally found it more logical to remove sourcemap comments prior to calculating compressed size. Would you be open to stripping those comments out as part of badge-size? In the past I've used strip-json-comments for this. Cheers!

Ambiguity of display

Your examples show 3.68 kB. Does this means it is around 3,680 bytes? The small k is ambiguous... Traditionally, we use KB for file sizes (except hard disk manufacturers, but they cheat).

Perhaps alternatively you can display as KiB, MiB and so on. This is increasingly popular and people are used to that already.

Registry for img.badgesize.io has expired!

WHOIS search results
Domain Name: badgesize.io
Registry Domain ID: 5cab44e96c4d426babc7588c50d04f88-DONUTS
Registrar WHOIS Server: whois.1api.net
Registrar URL: http://www.1api.net
Updated Date: 2024-03-24T19:09:19Z
Creation Date: 2016-02-09T18:38:33Z
Registry Expiry Date: 2024-02-09T18:38:33Z
Registrar: 1API GmbH

Support reference style

This is working:

![](http://img.badgesize.io/unional/color-map/master/dist/color-map.js)

This is not:

![](badge-size-url)

[badge-size-url]: http://img.badgesize.io/unional/color-map/master/dist/color-map.js

support uglify

would be great to allow to get the filesize when uglified. I have no uglified version in my repo but want to show the size taking uglification into account.

Would be great, if you would support this.

Not working for non-GitHub file?

Badges with softmax never turn red

Hi. It seems when using softmax, the value of max goes unused. No matter what value is present, max is ignored.

For example: https://img.badgesize.io/ngryman/badge-size/master/readme.md?softmax=1&max=2:

Readme

Consider adding optional threshold parameters for pass/fail

I feel this would be a useful feature to keep an eye on file sizes

e.g:

?pass=100000 - will give brightgreen for files under 100kb, red if not
?pass=100000&fail=200000 - will give brightgreen if size < 100kb, yellow if 100kb < size < 200kb, red if size > 200kb

knocked up a quick POC here but probably wouldn't need too much more work.

Awesome job with this btw!

Ability to read from NPM

I really like your idea, but my issue is that we don't commit our dist/ files. I was wondering if there was a way to read a file from NPM where the dist/ is published on release?

Public API?

Consider adding a .json file format that returns raw json data instead of an image.

This would allow badge rendering services such as https://badgen.net to be used with this service.

/cc @amio

Absolute URL cannot be displayed

Hello, I see #86 and #84 say that they have been solved, but there are still some problems and they still don't show. Could you please tell me what I wrote wrong.

gzip size: JS

[![gzip size: JS](https://img.badgesize.io/https://unpkg.com/vxe-table/lib/vxe-table.umd.min.js?compression=gzip&label=gzip%20size:%20JS)](https://unpkg.com/vxe-table/lib/vxe-table.umd.min.js)

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.