Announcing embeddable trend graphs for npm š
You can now supplement articles on javascript technologies with interactive charts of their download trends!
Charts from npmcharts.com can now also be expanded inline on Medium, Reddit, and other places that use Embed.ly to provide rich media embeds.
To embed these into medium articles, copy the url from npmcharts.com, e.g. āhttps://npmcharts.com/compare/lodashā, paste it into a new paragraph in the editor, then hit Enter.
Hereās a screenshot of what it looks like expanded on reddit:
Caveat
When pasting comparisons with a scoped package from the browserās address bar, you might see this:
@angular/core,vueā>https://npmcharts.com/compare/react,angular,@angular/core,vue
This is due to the@
character confusing Mediumās editor into thinking itās tagging someone. For now, the solution is as follows ā
- Delete the extra HTML in the beginning
- Double click the scoped package name and remove the link
- Move your cursor to the end of the url and hit enter
Dear module authors and maintainers
I would be honoured if you were to link to npmcharts.com via the package READMEās downloads badge. Hereās a snippet using lodash as an example:
[![NPM Downloads][downloads-image]][downloads-url][downloads-image]: https://img.shields.io/npm/dm/lodash.svg
[downloads-url]: https://npmcharts.com/compare/lodash?minimal=true
This would give you the shields.io badge that looks like this:
And which would link to https://npmcharts.com/compare/lodash?minimal=true
Ideas and feedback are very welcome! Thereās a roadmap of upcoming features on the projectās Github Issues. You can also tweet at me @CheapSteak, or follow @npmcharts to see download trends and comparisons of (occasionally esoteric) npm libraries.
Thanks to @Jephuff for proofreading, npm for npm and their API, and thanks again to Embed.ly for providing the platform and helping with integration.