badgen / badgen.net Goto Github PK
View Code? Open in Web Editor NEWFast badge service
Home Page: https://badgen.net
License: ISC License
Fast badge service
Home Page: https://badgen.net
License: ISC License
What about a badge without left hand-side label? Like this one with whole blue background:
The url could be:
/b/:status
- b
stands for "bare" or shrunk "badge"/bare/:status
The idea comes from this tweet, will it be useful? Maybe use it for twitter badge or something, I think it would be better looking than current social badge.
Take a vote, πfor useful, πfor not useful, πππfor url options 1/2/3.
https://developer.codeclimate.com/#overview
Seems there could be a badge for this:
API Endpoint
https://www.googleapis.com/pagespeedonline/v4/runPagespeed?url=https%3A%2F%2Fbadgen.net
Finally start building docs for live badges π»
Starting from packagephobia https://badgen.net/docs/packagephobia
This will allow more flexibility and users of the RunKit will be able to access whatever they need. For example, getting req.path
parsing it and getting queryparams so depending on some params, to base some logic.
For builtin ones, this will allow for listening on the registry_uri
, for example, in the npm live badge. No need to have global support (inside all live badges) for this or such query params. Even can be more, for example in the npm default export it will be passed only to the /npm/v
endpoint, so no security or such issues.
So
module.exports = async function npm (req, method, ...args) {
switch (method) {
case 'v':
return version(req, args)
case 'dt':
return download('total', args)
}
// code ...
}
async function version (req, args) {
const registry = qs.parse(req.path, true).registry_uri || 'registry.npmjs.org'
// code ...
}
So nor other npm endpoints, nor other live badges will have access to that registry_uri query param, it just won't matter.
Again. :D
@babel/core
is cyan, but shouldn't be, because it is latest
.
The cyan should be only if non-latest dist-tag is passed, no matter it is scoped or not.
I see that you support flat badges in badgen
, are they supported here? I'm not seeing anything about flat icons inside the docs.
Live badge with data from a runkit endpoint.
https://badgen.net/runkit/:endpoint_id/:params
RunKit Notebook: https://runkit.com/amio/peoples
RunKit Notebook: https://runkit.com/amio/satisfaction
The number you find here: https://github.com/chalk/chalk/network/dependents
GitHub has a GraphQL API endpoint for it: https://developer.github.com/changes/2018-04-24-preview-dependency-graph-and-vulnerability-hooks/
Can we think for adjust it to our needs?
https://www.vectorlogo.zone/logos/patreon/patreon-ar21.svg
I'm not on SVGs too much. ;d We can only get the "P" one, but should somehow invert the colors. Actually... the orange should be white and and the rest transparent?
I have a repo with 0 issues open. Unfortunately it's badge shows in red, which is discouraging.
Surely, where to draw the line between red/green is debatable, no question about it. But I'd say that 0 is a certain green.
Personally, 0 green and everything else red suits my needs, because my repo is small and I do intend to keep it on zero and will put a lot of effort on it!
Stars, Pulls, Build Status.
And as an example usage of icon.
Check the following badge:
https://badgen.net/github/open-issues/papb/better-promise-error-log
It shows "github | unknown", instead of the expected "open issues | 0".
What could be causing this?
Pretty much.. After the last changes related to the cache, it started to feels.
I sometimes am forced to visit the badgen badge url to trigger refresh.
Not to mention this not always works ;d
Even with F5, even with CTRL+R, even with another browser - nothing.
Run tests on real production environment πͺ
Thanks to now alias
this can be so easy!
"scripts": {
"deploy": "now && now alias badgen-canary",
"postdeploy": "TARGET=https://badgen-canary.now.sh npm run test"
}
More of a note to me.
Currently we get the "first in response array" tag/release.
The Babel example is perferct for showing the problem.
I think with /github/release/owner/repo
we should show latest stable release/tag. In the case with Babel latest one happens to be a "prerelease", so it shows it in orange.
I'm thinking for this
/github/release/owner/repo
should show lastest stable release (e.g. Babel's v6), in blue/github/release/owner/repo/prerelease
show latest prereleaseOr what about /github/prerelease/owner/repo
for the prereleases and /github/release
for the stable ones?
Perfect would be /github/release
and /github/prerelease
, because this will allow for static github badges like /github/release/owner/repo/v1.2.3
... which... actually, not make much sense because you can just /badge/release/v1.2.3/color
;d
πππ
https://badgen.now.sh will serves exactly the same as badgen.net, as long as badgen.net exists.
Secret: they are all now aliases of same service ;)
chrome-web-store, circleci, codecov, crates, david, github, homebrew, and uptime-robot, looking foward for more!
label
, emoji
, list
, checkout docs for details.
Say hi @badgen_net π€, updates are comming πͺ
So this is not a real issue but just an idea.
I see that today, loading badgen.net
takes 144 KB of bandwidth, and it will become bigger every time new badges are added.
As you said on your comment, the bandwidth usage is already pretty high, and I guess the index page is a big part of it.
Also, the response time on uptime robot is now > 500ms, which is a lot more than a few weeks ago.
Maybe you could use the free plan of Cloudflare to cache live badges for a few minutes, and static badges for a whole week!
Docs and index could also be cached for a few minutes
It could even prevent occasional downtime
It's always, or mostly always, a zero.
Probably we should use the /range
for the previous day, not for the current one.
I can dig what Shields does, but probably is that - for the previous day.
That's problem with the API actually:
https://api.npmjs.org/downloads/point/last-day/react
In most of the time it will show 0, i assume.
There are two kinds of live badge in badgen service:
If you would like to propose a badge, please post it here, the api service or the official badge url schema.
There's a long list on shields.io to implement one by one, hope that won't take too long :P
Pretty strange. Now it wants to be 3 days before ... ;d wat the heck. I totally should see how Shields handles this.
See https://forthebadge.com/
shields.io does support custom generation (not complete though) of those, what do you think ?
https://cirrus-ci.org/guide/writing-tasks/#embedded-badges
But not sure for the states. Also not sure which projects uses it so to use for examples.
I'm consider switching to it in near future. The only thing that stopping me currently is environment variables handling, which i highly depend on for my full automation of auto-release, auto-update and auto-publish flow.
The cool thing about CircleCi is that it allows you to have one "global store" of environment variables, so you set it once and every old and new project you setup you can access it.
It's quite slow to do that for each project. Add cirrus config file, go to cirrus dashboard add env to that specific repo and etc. All that was one of the reason i switched from travis.
So yea, Cirrus CI is amazing and fast, but. :D
Related to one answer in Reddit.
The suffix
is kinda good idea. But uri
may be a bit more complex.
uri
is for replacing the request endpoint, for example, to npm APIquery
is for selecting things from the return by uri
datasuffix
is value appeded to the right side of the badgeNo, seriously, that's all i need :D
And this service would be just enough and finished :D :)
Currently it should shows 100.0%
or 76.0%
and that's ugly. It should have decimal only if it is different than 0
.
I've added a "Badgen Story" to README.md (@olstenlarck I stole you a word :P), hoping to give new comers a general idea how Badgen comes from.
While I'm not sure I spells everything correctly and didn't cause anything confusion, if you find something weird please let me know π
Besides that, do you think there should be a guide(some sort of anatomy of the project) helping new contributor to get hands on this quickly? What should get explained/mentioned in the guide?
I see that the URI for the uptime of badgen-service is
https://badgen.net/uptime-robot/day/m780731617-a9e038618dc1aee36a44c4af
How to find the ID at the end of the URI ? I cannot find it from the stats page, which is https://stats.uptimerobot.com/z6nqBfYGB
Thanks for your help
Because the "workaround" https://github.com/amio/badgen-service/blob/master/libs/live-fns/npm.js#L96
It seems that https://registry.npmjs.org/@babel%2Fcore/*
shows empty object
but removing the star shows all versions.
proof: https://registry.npmjs.org/@babel%2Fcore
It's interesting why with @nestjs/core/*
it still works π
I'm not sure if this is a bug in badgen or Coveralls API, but shields.io seems to be returning the expected 100% while badgen seems to be using a percentage from a recent PR.
Badgen URL: https://flat.badgen.net/coveralls/c/github/expressjs/morgan/master
shields.io URL: https://img.shields.io/coveralls/expressjs/morgan/master.svg?style=flat-square
For consistency, i think it would be good all of the CIs to be build | passing
or build | success
, or every CI to have label its name, or every CI badge to be same, except icons
Always dreamed about that π
Would be awesoome if they include icons by default and be build | passing
.
Hm. What about "icon style" at icon.badgen.net
? So all badges will have their respective icons (if they have). How cool is that (btw, should add white icons too ;d)
I understand that my package kinda don't have downloads and/or api not refreshed yet, but would be better to show dowloads/month | unknown
or such like that.
Otherwise badges are broken.
I have a repo: https://github.com/styfle/packagephobia
I tried visiting https://badgen.now.sh/travis/styfle/packagephobia which redirects to https://api.travis-ci.com/styfle/packagephobia.svg?branch=master but that shows "build unknown".
My readme is currently using https://travis-ci.org/styfle/packagephobia.svg?branch=master which redirects to https://api.travis-ci.org/styfle/packagephobia.svg?branch=master and this correctly hows "build passing"
Note the difference here is .com
vs .org
.
Maybe you could add hackage bagdes like shields io
Would be nice to have a badge to show off how many npm packages depend on my package. For example, the 1717 Dependents
number at https://www.npmjs.com/package/got.
You could either:
david-dm supports passing a path
parameter to read package.json related to the github repo + path specified in the parameter.
This makes it possible for monorepos that include multiple packages (mulitple package.json files) to list dependency information via david-dm for the specific packages. Zendesk Garden is a monorepo using this feature of david-dm: https://github.com/zendeskgarden/react-components#installation
Note that zendesk garden is using shields.io for these badges.
This feature request is for adding path support for david-dm badges to badgen.
Here is a valid david-dm URL using path to get dependency info for package in a monorepo:
https://david-dm.org/cerner/terra-framework?path=packages/terra-hookshot
Here is what I'm thinking for the badgen API for this:
https://badgen.net/david/cerner/terra-framework?path=packages/terra-hookshot
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.