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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bgotink/list-exports

v0.2.1

Published

This package exposes functions that can be used to list a package's exports and imports.

Downloads

20

Readme

@bgotink/list-exports

This package exposes functions that can be used to list a package's exports and imports.

listExports

The listExports function expects one or two parameters:

export function listExports(
	location: string | URL,
	input?: ImportExportInput
): Promise<Array<ImportExport>>;
  • location is the path or full file URL to the package.json file
  • input can be provided, with multiple options:
    • packageJson (unknown), the package.json object. If a value is passed, it won't be read from location.
    • environment (node | browser | null, default: node) Environment condition to use in resolving
    • type (import | require | default | null, default: import when the package is imported and require when the package is required) Module type condition to load. The default condition is added unless the value null is passed.
    • extraCondition (string[], default: []) Extra conditions to allow

The returned ImportExport objects have four properties:

  • name is the export path as used to import the export. If the name is './deep/export' and the package is named pkg, the export can be imported as pkg/deep/export. The name of the main export is '.', not ''.
  • path is the path to the exported file, relative to the location.
  • registeredName is the export name as configured in the package.json file. If the export contains *, this property will still contain the *. That means that if the * export matches multiple files, more than one ImportExport will have the same registeredName.
  • registeredPath is the export path as configured in the package.json file. If the export contains *, this property will still contain the *. That means that if the * export matches multiple files, more than one ImportExport will have the same registeredPath.

listImports

The listImports function is identical to listExports, except it lists the package's imports rather than exports.

export function listImports(
	location: string | URL,
	input?: ImportExportInput
): Promise<Array<ImportExport>>;

License & Notice

This package is licensed under the MIT license, which can be found in LICENSE.md. Dependencies are bundled while publishing, check NOTICE.md in the published package for their licenses.