https://github.com/space307/pure-index
🌿 Clean your packages of unused exports with ease
https://github.com/space307/pure-index
cleanup cli ease export framework-agnostic import javascript-api maintenance monorepo unused workspace
Last synced: 22 days ago
JSON representation
🌿 Clean your packages of unused exports with ease
- Host: GitHub
- URL: https://github.com/space307/pure-index
- Owner: space307
- License: mit
- Created: 2023-12-25T12:35:16.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-05-05T02:01:26.000Z (9 months ago)
- Last Synced: 2025-11-09T08:32:21.431Z (3 months ago)
- Topics: cleanup, cli, ease, export, framework-agnostic, import, javascript-api, maintenance, monorepo, unused, workspace
- Language: TypeScript
- Homepage: https://space307.github.io/pure-index
- Size: 796 KB
- Stars: 21
- Watchers: 3
- Forks: 2
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
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](https://space307.github.io/pure-index/intro/cli) with an optional [configuration file](https://space307.github.io/pure-index/reference/configuration) or its [JavaScript API](https://space307.github.io/pure-index/intro/js-api).
1. Add the `check-exports` script in the `package.json` of packages that require checking.
```diff
"scripts": {
+ "check-exports": "pure-index"
}
```
2. Run
```sh
npm run check-exports
```
3. Depending on the project, you may need to [configure](https://space307.github.io/pure-index/reference/configuration) Pure Index.
## Documentation
Visit [our documentation site](https://space307.github.io/pure-index) for additional information, guides, and API references..