https://github.com/yaacov/yaindexer
Yet another typescript indexer
https://github.com/yaacov/yaindexer
Last synced: 7 months ago
JSON representation
Yet another typescript indexer
- Host: GitHub
- URL: https://github.com/yaacov/yaindexer
- Owner: yaacov
- License: apache-2.0
- Created: 2022-12-15T13:49:35.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-03T13:45:03.000Z (over 2 years ago)
- Last Synced: 2024-04-24T11:10:17.226Z (over 1 year ago)
- Language: JavaScript
- Size: 78.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://badge.fury.io/js/yaindexer)
# yaIndexer
Yet another typescript indexeryaIndexer and yaImportIndexer are tools that create index files for typescript and javascrpt code,
yaIndexer will automatically generate index.ts files with export-values from a list of files or folders.
yaImportIndexer will go over an application using a library and look for imports from this library. It will collect all the imports and create one index file that exports all the methods used in the code.
## Usage
### yaImportIndexer
Use source code of an app using a package, and automatically collect all imports from that package.
``` bash
npm install --location=global yaindexer# add npm bin path to your PATH, or use full
# excutable path, e.g. $(npm bin --location=global)/crdtoapi
yaImportIndexer --help# fetch all imports from @kubev2v/common package and collect them in
# one index.ts file
yaImportIndexer -i ./src -l @kubev2v/common
```### yaIndexer
Use a source code directory without index files, and add automatically generated index files.
``` bash
npm install --location=global yaindexer# add npm bin path to your PATH, or use full
# excutable path, e.g. $(npm bin --location=global)/crdtoapi
yaIndexer --help# add index files for your project
yaIndexer -i ./src# add index files for your project and overwrite the current index files
# with new version
yaIndexer --overwrite -i ./src# delete all index files in a project
find . -name "index.ts" -type f | xargs rm
```## Build
Run this scripts to lint and publish the package.
``` bash
npm install
npm run lint:fix
npm run build
npm publish
```## Other tools for auto generation of index files
https://www.npmjs.com/package/generate-index-file
https://github.com/gajus/create-index
https://github.com/cycloidio/import-index-generator
https://github.com/Jordan-Eckowitz/indexify-vscode-extension
https://github.com/fjc0k/vscode-generate-index