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 🙏

© 2025 – Pkg Stats / Ryan Hefner

get-details

v1.0.16

Published

Get package information directly on your web page without import and install

Readme

Get Details

Fetch package information directly on your web page in an aesthetic manner


Features

  • Runs instantly via CDN <script> tag
  • Config through a single data-get-details attribute
  • Supports multiple elements
  • Available as ES6 module
  • Return JSON without DOM manipulation
  • Supports NPM (default), GitHub and PyPI
  • Custom format reports

Usage

<p class="current-version"></p>
<script src="https://cdn.jsdelivr.net/npm/get-details" data-get-details="package_name"></script>

Extended Configuration

<div data-get-details="package_name, html element, package source, {%report %format}"></div>

Parameters:

data-get-details="[package-name][,][target-element][,][source],[{format}]"

  • 1st parameter (required): Package name to fetch data for.
  • 2nd parameter (optional): Target element selector where the data will be inserted. If not provided, defaults to #package-version, .current-version or any element with the data-get-details attribute.
  • 3rd parameter (optional): The data source (default: npm). Can be npm, github or pypi.
  • 4th parameter (optional): Custom format, specified within {} for personalized reporting.

ES6 Module Usage

Please install npm package

npm i get-details --save-dev

Import and initialize in your JavaScript:

  import getDetails from 'get-details/es.js';
  getDetails();

It still works with data-* but you can add parameters by functions argument

getDetails({ packageName: 'package-name', target: 'target-element', format: '{ %string }' });

Get JSON data only

Please add parameter str = true

const str = getDetails({ packageName: 'package-name', target: 'target-element', format: '{ %string }', str: true });
console.log(str);

Skypack CDN Usage

You can try to import ES6 module directly from CDN:

  import getDetails from 'https://cdn.skypack.dev/get-details/es6.js?min';
  getDetails();

Custom Format

You can customize the format of the fetched package information by passing a specific format string in the data-get-details attribute. This format string can include placeholders that will be dynamically replaced with package data.

** Placeholders:**

| key | description | |------------------|----------------------------------------| | %year | The current year. | | %copy | The copyright symbol (©). | | %name | The package name. | | %version | The package version. | | %description | The package description. | | %homepage | The homepage URL of the package. | | %author | The author's name. | | %license | The license information. | | %last-update | The last update date of the package. | | %stars | The number of stars (for GitHub). | | %forks | The number of forks (for GitHub). | | %language | The programming language (for GitHub). | | %repository | The repository URL. | | %maintainers | The names of maintainers. | | %downloads | The download count for the package. | | %release-date | The release date of the package. | | %release-notes | The release notes for the latest version. | | %owner | The owner of the repository. | | %requires | Whether the package requires Python (for PyPI). |

Example of custom format:

  <footer class="footer">
    <p class="copy"></p>
  </footer>

  <script src="https://cdn.jsdelivr.net/npm/get-details" data-get-details="get-details,.copy,npm,{'%year %copy %name %version - (%license)'}"></script>
</body>
</html>

Supported Sources

Currently supports fetching data from NPM, GitHub, PyPI and GitLab.

Supported CDN

| Service | URL | |------------------|------------------------------------------| | jsDelivr | https://cdn.jsdelivr.net/npm/get-details | | UNPKG | https://www.unpkg.com/get-details | | Skypack | https://cdn.skypack.dev/get-details |

Contributing

Contributions welcome! Feel free to:

  • Fork the repository
  • Submit pull requests
  • File issues
  • Suggest improvements

License

MIT License