Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

pure-index

space307159MIT1.1.0TypeScript support: included

Pure Index is a tool for packages. It helps to clean your packages of unused exports with ease.

analysis, analyze, cli, dead code, dependencies, detect, duplicate, entropy, export, import, index, files, find, javascript, lint, maintenance, members, missing, monorepo, namespace, package, scan, types, typescript, unreferenced, unresolved, usage, unused, workspace, ease, framework agnostic

readme

🌿 Pure Index

Pure Index is a tool for packages. It helps to clean your packages of unused exports with ease.
And it’s also speedy ⚡️

Motivation

We will use the @my/ui-kit package as an example.

`ts title="ui-kit/src/index.ts" export { Button } from './components/button'; export { Text } from './components/text';

export { ThemeProvider, useTheme, type Theme } from './themes'; ...


The number of exports increases over time. All of its exportable code requires support. But is all of it being used?

You can check this manually by just looping through the exports. It’s time-consuming, and there is a chance of error. What if multiple repositories use its code?

Let's automate this process!

## Installation

> You can use any package manager

```sh
npm install -D pure-index

Quick Start

Pure Index can be used either through a command line interface with an optional configuration file or its JavaScript API.

  1. Add the check-exports script in the package.json of packages that require checking.
    "scripts": {
+     "check-exports": "pure-index"
    }
  1. Run
npm run check-exports
  1. Depending on the project, you may need to configure Pure Index.

Documentation

Visit our documentation site for additional information, guides, and API references..

changelog


title: Change Log

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.1.0

Added

  • pkgName to JS Api -> findUnusedExports

Changed

  • bump dev deps

1.0.7

Changed

  • bump deps

1.0.6

Changed

  • bump deps

1.0.5

Changed

  • build with tsup
  • reduce package size

Fixed

  • typo in documentation

1.0.4

Changed

  • bump deps

1.0.3

Changed

  • bump @swc/core

1.0.2

Changed

  • bump @swc/core

1.0.1

Fixed

  • build flow

1.0.0

Changed

  • production ready