pure-index
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

🌿 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.

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

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..

Package Sidebar

Install

npm i pure-index

Weekly Downloads

58

Version

1.1.0

License

MIT

Unpacked Size

15.3 kB

Total Files

9

Last publish

Collaborators

  • binjospookie