# ls-exports

> CLI for `list-exports`: Given a package name and a version number, or a path to a package.json, what specifiers does it expose?

Latest version **2.1.0** (published 2026-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install ls-exports
pnpm add ls-exports
yarn add ls-exports
bun add ls-exports
```

Provides the command `ls-exports`.

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2026-07-28 |
| First published | 2020-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | ^22.22 \|\| ^24.13 \|\| >=25.3 |
| Dependencies | 7 |
| Unpacked size | 27.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | exports, cjs, esm, module, commonjs, es, export, entrypoint, resolve |

## Links

- npm: https://www.npmjs.com/package/ls-exports
- Repository: https://github.com/ljharb/list-exports
- Homepage: https://github.com/ljharb/list-exports#readme
- Issues: https://github.com/ljharb/list-exports/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/ls-exports

## Dependencies (7)

- [tmp](https://npm.io/package/tmp.md) ^0.2.7
- [pargs](https://npm.io/package/pargs.md) ^1.4.2
- [table](https://npm.io/package/table.md) ^6.9.0
- [pacote](https://npm.io/package/pacote.md) ^21.5.1
- [list-exports](https://npm.io/package/list-exports.md) ^2.3.0
- [json-colorizer](https://npm.io/package/json-colorizer.md) ^3.0.1
- [npm-package-arg](https://npm.io/package/npm-package-arg.md) ^14.0.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2026-07-28
- 2.0.2 — 2026-01-20
- 2.0.0 — 2026-01-15
- 1.1.1 — 2023-01-26
- 1.1.0 — 2020-10-22
- 1.0.2 — 2020-08-18
- 1.0.1 — 2020-08-02
- 1.0.0 — 2020-05-25

## README

# ls-exports <sup>[![Version Badge][npm-version-svg]][package-url]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][npm-badge-png]][package-url]

Given a package name and a version number, or a path to a package.json, what specifiers does it expose?

The package export defaults an `async function`. It fulfills with an object with the following keys:
  - `name` the package name
  - `version`: the package version
  - `engines`: the package's `engines` requirements
  - `binaries`: the files that are made available as executable programs
  - `errors`: any validation errors encountered during parsing. <sub>Note that these errors *do not* necessarily interfere with the listed entry points being accessible at runtime.</sub>

For ESM-supporting node versions (at the time of this writing, `^12.17 || >= 13.2`):
  - `require`: valid specifiers to pass into `require`
  - `import`: valid specifiers to pass into `import()`, or to use in a static `import` statement
  - `files`: all files on the filesystem that are directly exposed by the above entry points
  - `tree`: a hierarchical object structure where each directory is represented as a key containing an object, and each file is represented as a key containing a list of the entry points that expose that file

For node versions prior to ESM support (at the time of this writing, `< 12.17 || ~13.0 || ~13.1`):
  - `require (pre-exports)`: valid specifiers to pass into `require`
  - `files (pre-exports)`: all files on the filesystem that are directly exposed by the above entry points
  - `tree (pre-exports)`: a hierarchical object structure where each directory is represented as a key containing an object, and each file is represented as a key containing a list of the entry points that expose that file

## Example

```sh
ls-exports package resolve@1
```

[package-url]: https://npmjs.org/package/ls-exports
[npm-version-svg]: https://versionbadg.es/ljharb/list-exports.svg
[deps-svg]: https://david-dm.org/ljharb/list-exports.svg
[deps-url]: https://david-dm.org/ljharb/list-exports
[dev-deps-svg]: https://david-dm.org/ljharb/list-exports/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/list-exports#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/ls-exports.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/ls-exports.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/ls-exports.svg
[downloads-url]: https://npm-stat.com/charts.html?package=ls-exports
[codecov-image]: https://codecov.io/gh/ljharb/list-exports/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/list-exports/
[actions-image]: https://img.shields.io/github/check-runs/ljharb/list-exports/main
[actions-url]: https://github.com/ljharb/list-exports/actions
[category]: https://github.com/inspect-js/node-exports-info#categories

---
_Source: https://npm.io/package/ls-exports · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
